OpenCV  3.1.0
Open Source Computer Vision
Classes | Namespaces | Enumerations | Functions
calib3d.hpp File Reference
#include "opencv2/core.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/core/affine.hpp"
#include "opencv2/calib3d/calib3d_c.h"

Classes

class  cv::StereoBM
 Class for computing stereo correspondence using the block matching algorithm, introduced and contributed to OpenCV by K. Konolige. More...
 
class  cv::StereoMatcher
 The base class for stereo correspondence algorithms. More...
 
class  cv::StereoSGBM
 The class implements the modified H. Hirschmuller algorithm [68] that differs from the original one as follows: More...
 

Namespaces

 cv
 
 cv::fisheye
 The methods in this namespace use a so-called fisheye camera model.
 

Enumerations

enum  {
  cv::LMEDS = 4,
  cv::RANSAC = 8,
  cv::RHO = 16
}
 type of the robust estimation algorithm More...
 
enum  {
  cv::SOLVEPNP_ITERATIVE = 0,
  cv::SOLVEPNP_EPNP = 1,
  cv::SOLVEPNP_P3P = 2,
  cv::SOLVEPNP_DLS = 3,
  cv::SOLVEPNP_UPNP = 4
}
 
enum  {
  cv::CALIB_CB_ADAPTIVE_THRESH = 1,
  cv::CALIB_CB_NORMALIZE_IMAGE = 2,
  cv::CALIB_CB_FILTER_QUADS = 4,
  cv::CALIB_CB_FAST_CHECK = 8
}
 
enum  {
  cv::CALIB_CB_SYMMETRIC_GRID = 1,
  cv::CALIB_CB_ASYMMETRIC_GRID = 2,
  cv::CALIB_CB_CLUSTERING = 4
}
 
enum  {
  cv::CALIB_USE_INTRINSIC_GUESS = 0x00001,
  cv::CALIB_FIX_ASPECT_RATIO = 0x00002,
  cv::CALIB_FIX_PRINCIPAL_POINT = 0x00004,
  cv::CALIB_ZERO_TANGENT_DIST = 0x00008,
  cv::CALIB_FIX_FOCAL_LENGTH = 0x00010,
  cv::CALIB_FIX_K1 = 0x00020,
  cv::CALIB_FIX_K2 = 0x00040,
  cv::CALIB_FIX_K3 = 0x00080,
  cv::CALIB_FIX_K4 = 0x00800,
  cv::CALIB_FIX_K5 = 0x01000,
  cv::CALIB_FIX_K6 = 0x02000,
  cv::CALIB_RATIONAL_MODEL = 0x04000,
  cv::CALIB_THIN_PRISM_MODEL = 0x08000,
  cv::CALIB_FIX_S1_S2_S3_S4 = 0x10000,
  cv::CALIB_TILTED_MODEL = 0x40000,
  cv::CALIB_FIX_TAUX_TAUY = 0x80000,
  cv::CALIB_FIX_INTRINSIC = 0x00100,
  cv::CALIB_SAME_FOCAL_LENGTH = 0x00200,
  cv::CALIB_ZERO_DISPARITY = 0x00400,
  cv::CALIB_USE_LU = (1 << 17)
}
 
enum  {
  cv::FM_7POINT = 1,
  cv::FM_8POINT = 2,
  cv::FM_LMEDS = 4,
  cv::FM_RANSAC = 8
}
 the algorithm for finding fundamental matrix More...
 
enum  {
  cv::fisheye::CALIB_USE_INTRINSIC_GUESS = 1,
  cv::fisheye::CALIB_RECOMPUTE_EXTRINSIC = 2,
  cv::fisheye::CALIB_CHECK_COND = 4,
  cv::fisheye::CALIB_FIX_SKEW = 8,
  cv::fisheye::CALIB_FIX_K1 = 16,
  cv::fisheye::CALIB_FIX_K2 = 32,
  cv::fisheye::CALIB_FIX_K3 = 64,
  cv::fisheye::CALIB_FIX_K4 = 128,
  cv::fisheye::CALIB_FIX_INTRINSIC = 256
}
 

Functions

double cv::fisheye::calibrate (InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size &image_size, InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags=0, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, DBL_EPSILON))
 Performs camera calibaration. More...
 
double cv::calibrateCamera (InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags=0, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON))
 Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. More...
 
void cv::calibrationMatrixValues (InputArray cameraMatrix, Size imageSize, double apertureWidth, double apertureHeight, double &fovx, double &fovy, double &focalLength, Point2d &principalPoint, double &aspectRatio)
 Computes useful camera characteristics from the camera matrix. More...
 
void cv::composeRT (InputArray rvec1, InputArray tvec1, InputArray rvec2, InputArray tvec2, OutputArray rvec3, OutputArray tvec3, OutputArray dr3dr1=noArray(), OutputArray dr3dt1=noArray(), OutputArray dr3dr2=noArray(), OutputArray dr3dt2=noArray(), OutputArray dt3dr1=noArray(), OutputArray dt3dt1=noArray(), OutputArray dt3dr2=noArray(), OutputArray dt3dt2=noArray())
 Combines two rotation-and-shift transformations. More...
 
void cv::computeCorrespondEpilines (InputArray points, int whichImage, InputArray F, OutputArray lines)
 For points in an image of a stereo pair, computes the corresponding epilines in the other image. More...
 
void cv::convertPointsFromHomogeneous (InputArray src, OutputArray dst)
 Converts points from homogeneous to Euclidean space. More...
 
void cv::convertPointsHomogeneous (InputArray src, OutputArray dst)
 Converts points to/from homogeneous coordinates. More...
 
void cv::convertPointsToHomogeneous (InputArray src, OutputArray dst)
 Converts points from Euclidean to homogeneous space. More...
 
void cv::correctMatches (InputArray F, InputArray points1, InputArray points2, OutputArray newPoints1, OutputArray newPoints2)
 Refines coordinates of corresponding points. More...
 
void cv::decomposeEssentialMat (InputArray E, OutputArray R1, OutputArray R2, OutputArray t)
 Decompose an essential matrix to possible rotations and translation. More...
 
int cv::decomposeHomographyMat (InputArray H, InputArray K, OutputArrayOfArrays rotations, OutputArrayOfArrays translations, OutputArrayOfArrays normals)
 Decompose a homography matrix to rotation(s), translation(s) and plane normal(s). More...
 
void cv::decomposeProjectionMatrix (InputArray projMatrix, OutputArray cameraMatrix, OutputArray rotMatrix, OutputArray transVect, OutputArray rotMatrixX=noArray(), OutputArray rotMatrixY=noArray(), OutputArray rotMatrixZ=noArray(), OutputArray eulerAngles=noArray())
 Decomposes a projection matrix into a rotation matrix and a camera matrix. More...
 
void cv::fisheye::distortPoints (InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha=0)
 Distorts 2D points using fisheye model. More...
 
void cv::drawChessboardCorners (InputOutputArray image, Size patternSize, InputArray corners, bool patternWasFound)
 Renders the detected chessboard corners. More...
 
int cv::estimateAffine3D (InputArray src, InputArray dst, OutputArray out, OutputArray inliers, double ransacThreshold=3, double confidence=0.99)
 Computes an optimal affine transformation between two 3D point sets. More...
 
void cv::fisheye::estimateNewCameraMatrixForUndistortRectify (InputArray K, InputArray D, const Size &image_size, InputArray R, OutputArray P, double balance=0.0, const Size &new_size=Size(), double fov_scale=1.0)
 Estimates new camera matrix for undistortion or rectification. More...
 
void cv::filterSpeckles (InputOutputArray img, double newVal, int maxSpeckleSize, double maxDiff, InputOutputArray buf=noArray())
 Filters off small noise blobs (speckles) in the disparity map. More...
 
bool cv::find4QuadCornerSubpix (InputArray img, InputOutputArray corners, Size region_size)
 finds subpixel-accurate positions of the chessboard corners More...
 
bool cv::findChessboardCorners (InputArray image, Size patternSize, OutputArray corners, int flags=CALIB_CB_ADAPTIVE_THRESH+CALIB_CB_NORMALIZE_IMAGE)
 Finds the positions of internal corners of the chessboard. More...
 
bool cv::findCirclesGrid (InputArray image, Size patternSize, OutputArray centers, int flags=CALIB_CB_SYMMETRIC_GRID, const Ptr< FeatureDetector > &blobDetector=SimpleBlobDetector::create())
 Finds centers in the grid of circles. More...
 
Mat cv::findEssentialMat (InputArray points1, InputArray points2, InputArray cameraMatrix, int method=RANSAC, double prob=0.999, double threshold=1.0, OutputArray mask=noArray())
 Calculates an essential matrix from the corresponding points in two images. More...
 
Mat cv::findEssentialMat (InputArray points1, InputArray points2, double focal=1.0, Point2d pp=Point2d(0, 0), int method=RANSAC, double prob=0.999, double threshold=1.0, OutputArray mask=noArray())
 
Mat cv::findFundamentalMat (InputArray points1, InputArray points2, int method=FM_RANSAC, double param1=3., double param2=0.99, OutputArray mask=noArray())
 Calculates a fundamental matrix from the corresponding points in two images. More...
 
Mat cv::findFundamentalMat (InputArray points1, InputArray points2, OutputArray mask, int method=FM_RANSAC, double param1=3., double param2=0.99)
 
Mat cv::findHomography (InputArray srcPoints, InputArray dstPoints, int method=0, double ransacReprojThreshold=3, OutputArray mask=noArray(), const int maxIters=2000, const double confidence=0.995)
 Finds a perspective transformation between two planes. More...
 
Mat cv::findHomography (InputArray srcPoints, InputArray dstPoints, OutputArray mask, int method=0, double ransacReprojThreshold=3)
 
Mat cv::getOptimalNewCameraMatrix (InputArray cameraMatrix, InputArray distCoeffs, Size imageSize, double alpha, Size newImgSize=Size(), Rect *validPixROI=0, bool centerPrincipalPoint=false)
 Returns the new camera matrix based on the free scaling parameter. More...
 
Rect cv::getValidDisparityROI (Rect roi1, Rect roi2, int minDisparity, int numberOfDisparities, int SADWindowSize)
 computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by cv::stereoRectify()) More...
 
Mat cv::initCameraMatrix2D (InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, Size imageSize, double aspectRatio=1.0)
 Finds an initial camera matrix from 3D-2D point correspondences. More...
 
void cv::fisheye::initUndistortRectifyMap (InputArray K, InputArray D, InputArray R, InputArray P, const cv::Size &size, int m1type, OutputArray map1, OutputArray map2)
 Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero distortion is used, if R or P is empty identity matrixes are used. More...
 
void cv::matMulDeriv (InputArray A, InputArray B, OutputArray dABdA, OutputArray dABdB)
 Computes partial derivatives of the matrix product for each multiplied matrix. More...
 
void cv::projectPoints (InputArray objectPoints, InputArray rvec, InputArray tvec, InputArray cameraMatrix, InputArray distCoeffs, OutputArray imagePoints, OutputArray jacobian=noArray(), double aspectRatio=0)
 Projects 3D points to an image plane. More...
 
void cv::fisheye::projectPoints (InputArray objectPoints, OutputArray imagePoints, const Affine3d &affine, InputArray K, InputArray D, double alpha=0, OutputArray jacobian=noArray())
 Projects points using fisheye model. More...
 
void cv::fisheye::projectPoints (InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, InputArray K, InputArray D, double alpha=0, OutputArray jacobian=noArray())
 
int cv::recoverPose (InputArray E, InputArray points1, InputArray points2, InputArray cameraMatrix, OutputArray R, OutputArray t, InputOutputArray mask=noArray())
 Recover relative camera rotation and translation from an estimated essential matrix and the corresponding points in two images, using cheirality check. Returns the number of inliers which pass the check. More...
 
int cv::recoverPose (InputArray E, InputArray points1, InputArray points2, OutputArray R, OutputArray t, double focal=1.0, Point2d pp=Point2d(0, 0), InputOutputArray mask=noArray())
 
float cv::rectify3Collinear (InputArray cameraMatrix1, InputArray distCoeffs1, InputArray cameraMatrix2, InputArray distCoeffs2, InputArray cameraMatrix3, InputArray distCoeffs3, InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3, Size imageSize, InputArray R12, InputArray T12, InputArray R13, InputArray T13, OutputArray R1, OutputArray R2, OutputArray R3, OutputArray P1, OutputArray P2, OutputArray P3, OutputArray Q, double alpha, Size newImgSize, Rect *roi1, Rect *roi2, int flags)
 computes the rectification transformations for 3-head camera, where all the heads are on the same line. More...
 
void cv::reprojectImageTo3D (InputArray disparity, OutputArray _3dImage, InputArray Q, bool handleMissingValues=false, int ddepth=-1)
 Reprojects a disparity image to 3D space. More...
 
void cv::Rodrigues (InputArray src, OutputArray dst, OutputArray jacobian=noArray())
 Converts a rotation matrix to a rotation vector or vice versa. More...
 
Vec3d cv::RQDecomp3x3 (InputArray src, OutputArray mtxR, OutputArray mtxQ, OutputArray Qx=noArray(), OutputArray Qy=noArray(), OutputArray Qz=noArray())
 Computes an RQ decomposition of 3x3 matrices. More...
 
double cv::sampsonDistance (InputArray pt1, InputArray pt2, InputArray F)
 Calculates the Sampson Distance between two points. More...
 
bool cv::solvePnP (InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int flags=SOLVEPNP_ITERATIVE)
 Finds an object pose from 3D-2D point correspondences. More...
 
bool cv::solvePnPRansac (InputArray objectPoints, InputArray imagePoints, InputArray cameraMatrix, InputArray distCoeffs, OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess=false, int iterationsCount=100, float reprojectionError=8.0, double confidence=0.99, OutputArray inliers=noArray(), int flags=SOLVEPNP_ITERATIVE)
 Finds an object pose from 3D-2D point correspondences using the RANSAC scheme. More...
 
double cv::stereoCalibrate (InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1, InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2, Size imageSize, OutputArray R, OutputArray T, OutputArray E, OutputArray F, int flags=CALIB_FIX_INTRINSIC, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6))
 Calibrates the stereo camera. More...
 
double cv::fisheye::stereoCalibrate (InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, OutputArray R, OutputArray T, int flags=fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria=TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, DBL_EPSILON))
 Performs stereo calibration. More...
 
void cv::stereoRectify (InputArray cameraMatrix1, InputArray distCoeffs1, InputArray cameraMatrix2, InputArray distCoeffs2, Size imageSize, InputArray R, InputArray T, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags=CALIB_ZERO_DISPARITY, double alpha=-1, Size newImageSize=Size(), Rect *validPixROI1=0, Rect *validPixROI2=0)
 Computes rectification transforms for each head of a calibrated stereo camera. More...
 
void cv::fisheye::stereoRectify (InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize=Size(), double balance=0.0, double fov_scale=1.0)
 Stereo rectification for fisheye camera model. More...
 
bool cv::stereoRectifyUncalibrated (InputArray points1, InputArray points2, InputArray F, Size imgSize, OutputArray H1, OutputArray H2, double threshold=5)
 Computes a rectification transform for an uncalibrated stereo camera. More...
 
void cv::triangulatePoints (InputArray projMatr1, InputArray projMatr2, InputArray projPoints1, InputArray projPoints2, OutputArray points4D)
 Reconstructs points by triangulation. More...
 
void cv::fisheye::undistortImage (InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray Knew=cv::noArray(), const Size &new_size=Size())
 Transforms an image to compensate for fisheye lens distortion. More...
 
void cv::fisheye::undistortPoints (InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray R=noArray(), InputArray P=noArray())
 Undistorts 2D points using fisheye model. More...
 
void cv::validateDisparity (InputOutputArray disparity, InputArray cost, int minDisparity, int numberOfDisparities, int disp12MaxDisp=1)
 validates disparity using the left-right check. The matrix "cost" should be computed by the stereo correspondence algorithm More...