@ -674,15 +674,15 @@ or vector\<Point2f\> .
a vector \ < Point2f \ > .
a vector \ < Point2f \ > .
@ param method Method used to compute a homography matrix . The following methods are possible :
@ param method Method used to compute a homography matrix . The following methods are possible :
- * * 0 * * - a regular method using all the points , i . e . , the least squares method
- * * 0 * * - a regular method using all the points , i . e . , the least squares method
- * * RANSAC * * - RANSAC - based robust method
- @ ref RANSAC - RANSAC - based robust method
- * * LMEDS * * - Least - Median robust method
- @ ref LMEDS - Least - Median robust method
- * * RHO * * - PROSAC - based robust method
- @ ref RHO - PROSAC - based robust method
@ param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier
@ param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier
( used in the RANSAC and RHO methods only ) . That is , if
( used in the RANSAC and RHO methods only ) . That is , if
\ f [ \ | \ texttt { dstPoints } _i - \ texttt { convertPointsHomogeneous } ( \ texttt { H } * \ texttt { srcPoints } _i ) \ | _2 > \ texttt { ransacReprojThreshold } \ f ]
\ f [ \ | \ texttt { dstPoints } _i - \ texttt { convertPointsHomogeneous } ( \ texttt { H } * \ texttt { srcPoints } _i ) \ | _2 > \ texttt { ransacReprojThreshold } \ f ]
then the point \ f $ i \ f $ is considered as an outlier . If srcPoints and dstPoints are measured in pixels ,
then the point \ f $ i \ f $ is considered as an outlier . If srcPoints and dstPoints are measured in pixels ,
it usually makes sense to set this parameter somewhere in the range of 1 to 10.
it usually makes sense to set this parameter somewhere in the range of 1 to 10.
@ param mask Optional output mask set by a robust method ( RANSAC or LME DS ) . Note that the input
@ param mask Optional output mask set by a robust method ( RANSAC or LMe DS ) . Note that the input
mask values are ignored .
mask values are ignored .
@ param maxIters The maximum number of RANSAC iterations .
@ param maxIters The maximum number of RANSAC iterations .
@ param confidence Confidence level , between 0 and 1.
@ param confidence Confidence level , between 0 and 1.
@ -917,37 +917,37 @@ the model coordinate system to the camera coordinate system.
the provided rvec and tvec values as initial approximations of the rotation and translation
the provided rvec and tvec values as initial approximations of the rotation and translation
vectors , respectively , and further optimizes them .
vectors , respectively , and further optimizes them .
@ param flags Method for solving a PnP problem :
@ param flags Method for solving a PnP problem :
- * * SOLVEPNP_ITERATIVE * * Iterative method is based on a Levenberg - Marquardt optimization . In
- @ ref SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg - Marquardt optimization . In
this case the function finds such a pose that minimizes reprojection error , that is the sum
this case the function finds such a pose that minimizes reprojection error , that is the sum
of squared distances between the observed projections imagePoints and the projected ( using
of squared distances between the observed projections imagePoints and the projected ( using
@ ref projectPoints ) objectPoints .
@ ref projectPoints ) objectPoints .
- * * SOLVEPNP_P3P * * Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
- @ ref SOLVEPNP_P3P Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
In this case the function requires exactly four object and image points .
In this case the function requires exactly four object and image points .
- * * SOLVEPNP_AP3P * * Method is based on the paper of T . Ke , S . Roumeliotis
- @ ref SOLVEPNP_AP3P Method is based on the paper of T . Ke , S . Roumeliotis
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
In this case the function requires exactly four object and image points .
In this case the function requires exactly four object and image points .
- * * SOLVEPNP_EPNP * * Method has been introduced by F . Moreno - Noguer , V . Lepetit and P . Fua in the
- @ ref SOLVEPNP_EPNP Method has been introduced by F . Moreno - Noguer , V . Lepetit and P . Fua in the
paper " EPnP: Efficient Perspective-n-Point Camera Pose Estimation " ( @ cite lepetit2009epnp ) .
paper " EPnP: Efficient Perspective-n-Point Camera Pose Estimation " ( @ cite lepetit2009epnp ) .
- * * SOLVEPNP_DLS * * * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
- @ ref SOLVEPNP_DLS * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
Method is based on the paper of J . Hesch and S . Roumeliotis .
Method is based on the paper of J . Hesch and S . Roumeliotis .
" A Direct Least-Squares (DLS) Method for PnP " ( @ cite hesch2011direct ) .
" A Direct Least-Squares (DLS) Method for PnP " ( @ cite hesch2011direct ) .
- * * SOLVEPNP_UPNP * * * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
- @ ref SOLVEPNP_UPNP * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
Method is based on the paper of A . Penate - Sanchez , J . Andrade - Cetto ,
Method is based on the paper of A . Penate - Sanchez , J . Andrade - Cetto ,
F . Moreno - Noguer . " Exhaustive Linearization for Robust Camera Pose and Focal Length
F . Moreno - Noguer . " Exhaustive Linearization for Robust Camera Pose and Focal Length
Estimation " (@cite penate2013exhaustive). In this case the function also estimates the parameters \f $f_x \f $ and \f $f_y \f $
Estimation " (@cite penate2013exhaustive). In this case the function also estimates the parameters \f $f_x \f $ and \f $f_y \f $
assuming that both have the same value . Then the cameraMatrix is updated with the estimated
assuming that both have the same value . Then the cameraMatrix is updated with the estimated
focal length .
focal length .
- * * SOLVEPNP_IPPE * * Method is based on the paper of T . Collins and A . Bartoli .
- @ ref SOLVEPNP_IPPE Method is based on the paper of T . Collins and A . Bartoli .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method requires coplanar object points .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method requires coplanar object points .
- * * SOLVEPNP_IPPE_SQUARE * * Method is based on the paper of Toby Collins and Adrien Bartoli .
- @ ref SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method is suitable for marker pose estimation .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method is suitable for marker pose estimation .
It requires 4 coplanar object points defined in the following order :
It requires 4 coplanar object points defined in the following order :
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
- * * SOLVEPNP_SQPNP * * Method is based on the paper " A Consistently Fast and Globally Optimal Solution to the
- @ ref SOLVEPNP_SQPNP Method is based on the paper " A Consistently Fast and Globally Optimal Solution to the
Perspective - n - Point Problem " by G. Terzakis and M.Lourakis (@cite Terzakis20). It requires 3 or more points.
Perspective - n - Point Problem " by G. Terzakis and M.Lourakis (@cite Terzakis20). It requires 3 or more points.
@ -1057,23 +1057,23 @@ a 3D point expressed in the world frame into the camera frame:
- Thus , given some data D = np . array ( . . . ) where D . shape = ( N , M ) , in order to use a subset of
- Thus , given some data D = np . array ( . . . ) where D . shape = ( N , M ) , in order to use a subset of
it as , e . g . , imagePoints , one must effectively copy it into a new array : imagePoints =
it as , e . g . , imagePoints , one must effectively copy it into a new array : imagePoints =
np . ascontiguousarray ( D [ : , : 2 ] ) . reshape ( ( N , 1 , 2 ) )
np . ascontiguousarray ( D [ : , : 2 ] ) . reshape ( ( N , 1 , 2 ) )
- The methods * * SOLVEPNP_DLS * * and * * SOLVEPNP_UPNP * * cannot be used as the current implementations are
- The methods @ ref SOLVEPNP_DLS and @ ref SOLVEPNP_UPNP cannot be used as the current implementations are
unstable and sometimes give completely wrong results . If you pass one of these two
unstable and sometimes give completely wrong results . If you pass one of these two
flags , * * SOLVEPNP_EPNP * * method will be used instead .
flags , @ ref SOLVEPNP_EPNP method will be used instead .
- The minimum number of points is 4 in the general case . In the case of * * SOLVEPNP_P3P * * and * * SOLVEPNP_AP3P * *
- The minimum number of points is 4 in the general case . In the case of @ ref SOLVEPNP_P3P and @ ref SOLVEPNP_AP3P
methods , it is required to use exactly 4 points ( the first 3 points are used to estimate all the solutions
methods , it is required to use exactly 4 points ( the first 3 points are used to estimate all the solutions
of the P3P problem , the last one is used to retain the best solution that minimizes the reprojection error ) .
of the P3P problem , the last one is used to retain the best solution that minimizes the reprojection error ) .
- With * * SOLVEPNP_ITERATIVE * * method and ` useExtrinsicGuess = true ` , the minimum number of points is 3 ( 3 points
- With @ ref SOLVEPNP_ITERATIVE method and ` useExtrinsicGuess = true ` , the minimum number of points is 3 ( 3 points
are sufficient to compute a pose but there are up to 4 solutions ) . The initial solution should be close to the
are sufficient to compute a pose but there are up to 4 solutions ) . The initial solution should be close to the
global solution to converge .
global solution to converge .
- With * * SOLVEPNP_IPPE * * input points must be > = 4 and object points must be coplanar .
- With @ ref SOLVEPNP_IPPE input points must be > = 4 and object points must be coplanar .
- With * * SOLVEPNP_IPPE_SQUARE * * this is a special case suitable for marker pose estimation .
- With @ ref SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation .
Number of input points must be 4. Object points must be defined in the following order :
Number of input points must be 4. Object points must be defined in the following order :
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
- With * * SOLVEPNP_SQPNP * * input points must be > = 3
- With @ ref SOLVEPNP_SQPNP input points must be > = 3
*/
*/
CV_EXPORTS_W bool solvePnP ( InputArray objectPoints , InputArray imagePoints ,
CV_EXPORTS_W bool solvePnP ( InputArray objectPoints , InputArray imagePoints ,
InputArray cameraMatrix , InputArray distCoeffs ,
InputArray cameraMatrix , InputArray distCoeffs ,
@ -1152,9 +1152,9 @@ assumed.
the model coordinate system to the camera coordinate system . A P3P problem has up to 4 solutions .
the model coordinate system to the camera coordinate system . A P3P problem has up to 4 solutions .
@ param tvecs Output translation vectors .
@ param tvecs Output translation vectors .
@ param flags Method for solving a P3P problem :
@ param flags Method for solving a P3P problem :
- * * SOLVEPNP_P3P * * Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
- @ ref SOLVEPNP_P3P Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
- * * SOLVEPNP_AP3P * * Method is based on the paper of T . Ke and S . Roumeliotis .
- @ ref SOLVEPNP_AP3P Method is based on the paper of T . Ke and S . Roumeliotis .
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
The function estimates the object pose given 3 object points , their corresponding image
The function estimates the object pose given 3 object points , their corresponding image
@ -1254,39 +1254,39 @@ the model coordinate system to the camera coordinate system.
the provided rvec and tvec values as initial approximations of the rotation and translation
the provided rvec and tvec values as initial approximations of the rotation and translation
vectors , respectively , and further optimizes them .
vectors , respectively , and further optimizes them .
@ param flags Method for solving a PnP problem :
@ param flags Method for solving a PnP problem :
- * * SOLVEPNP_ITERATIVE * * Iterative method is based on a Levenberg - Marquardt optimization . In
- @ ref SOLVEPNP_ITERATIVE Iterative method is based on a Levenberg - Marquardt optimization . In
this case the function finds such a pose that minimizes reprojection error , that is the sum
this case the function finds such a pose that minimizes reprojection error , that is the sum
of squared distances between the observed projections imagePoints and the projected ( using
of squared distances between the observed projections imagePoints and the projected ( using
projectPoints ) objectPoints .
projectPoints ) objectPoints .
- * * SOLVEPNP_P3P * * Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
- @ ref SOLVEPNP_P3P Method is based on the paper of X . S . Gao , X . - R . Hou , J . Tang , H . - F . Chang
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
" Complete Solution Classification for the Perspective-Three-Point Problem " ( @ cite gao2003complete ) .
In this case the function requires exactly four object and image points .
In this case the function requires exactly four object and image points .
- * * SOLVEPNP_AP3P * * Method is based on the paper of T . Ke , S . Roumeliotis
- @ ref SOLVEPNP_AP3P Method is based on the paper of T . Ke , S . Roumeliotis
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
" An Efficient Algebraic Solution to the Perspective-Three-Point Problem " ( @ cite Ke17 ) .
In this case the function requires exactly four object and image points .
In this case the function requires exactly four object and image points .
- * * SOLVEPNP_EPNP * * Method has been introduced by F . Moreno - Noguer , V . Lepetit and P . Fua in the
- @ ref SOLVEPNP_EPNP Method has been introduced by F . Moreno - Noguer , V . Lepetit and P . Fua in the
paper " EPnP: Efficient Perspective-n-Point Camera Pose Estimation " ( @ cite lepetit2009epnp ) .
paper " EPnP: Efficient Perspective-n-Point Camera Pose Estimation " ( @ cite lepetit2009epnp ) .
- * * SOLVEPNP_DLS * * * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
- @ ref SOLVEPNP_DLS * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
Method is based on the paper of Joel A . Hesch and Stergios I . Roumeliotis .
Method is based on the paper of Joel A . Hesch and Stergios I . Roumeliotis .
" A Direct Least-Squares (DLS) Method for PnP " ( @ cite hesch2011direct ) .
" A Direct Least-Squares (DLS) Method for PnP " ( @ cite hesch2011direct ) .
- * * SOLVEPNP_UPNP * * * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
- @ ref SOLVEPNP_UPNP * * Broken implementation . Using this flag will fallback to EPnP . * * \ n
Method is based on the paper of A . Penate - Sanchez , J . Andrade - Cetto ,
Method is based on the paper of A . Penate - Sanchez , J . Andrade - Cetto ,
F . Moreno - Noguer . " Exhaustive Linearization for Robust Camera Pose and Focal Length
F . Moreno - Noguer . " Exhaustive Linearization for Robust Camera Pose and Focal Length
Estimation " (@cite penate2013exhaustive). In this case the function also estimates the parameters \f $f_x \f $ and \f $f_y \f $
Estimation " (@cite penate2013exhaustive). In this case the function also estimates the parameters \f $f_x \f $ and \f $f_y \f $
assuming that both have the same value . Then the cameraMatrix is updated with the estimated
assuming that both have the same value . Then the cameraMatrix is updated with the estimated
focal length .
focal length .
- * * SOLVEPNP_IPPE * * Method is based on the paper of T . Collins and A . Bartoli .
- @ ref SOLVEPNP_IPPE Method is based on the paper of T . Collins and A . Bartoli .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method requires coplanar object points .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method requires coplanar object points .
- * * SOLVEPNP_IPPE_SQUARE * * Method is based on the paper of Toby Collins and Adrien Bartoli .
- @ ref SOLVEPNP_IPPE_SQUARE Method is based on the paper of Toby Collins and Adrien Bartoli .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method is suitable for marker pose estimation .
" Infinitesimal Plane-Based Pose Estimation " ( @ cite Collins14 ) . This method is suitable for marker pose estimation .
It requires 4 coplanar object points defined in the following order :
It requires 4 coplanar object points defined in the following order :
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 2 : [ squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
- point 3 : [ - squareLength / 2 , - squareLength / 2 , 0 ]
@ param rvec Rotation vector used to initialize an iterative PnP refinement algorithm , when flag is SOLVEPNP_ITERATIVE
@ param rvec Rotation vector used to initialize an iterative PnP refinement algorithm , when flag is @ ref SOLVEPNP_ITERATIVE
and useExtrinsicGuess is set to true .
and useExtrinsicGuess is set to true .
@ param tvec Translation vector used to initialize an iterative PnP refinement algorithm , when flag is SOLVEPNP_ITERATIVE
@ param tvec Translation vector used to initialize an iterative PnP refinement algorithm , when flag is @ ref SOLVEPNP_ITERATIVE
and useExtrinsicGuess is set to true .
and useExtrinsicGuess is set to true .
@ param reprojectionError Optional vector of reprojection error , that is the RMS error
@ param reprojectionError Optional vector of reprojection error , that is the RMS error
( \ f $ \ text { RMSE } = \ sqrt { \ frac { \ sum_ { i } ^ { N } \ left ( \ hat { y_i } - y_i \ right ) ^ 2 } { N } } \ f $ ) between the input image points
( \ f $ \ text { RMSE } = \ sqrt { \ frac { \ sum_ { i } ^ { N } \ left ( \ hat { y_i } - y_i \ right ) ^ 2 } { N } } \ f $ ) between the input image points
@ -1398,17 +1398,17 @@ a 3D point expressed in the world frame into the camera frame:
- Thus , given some data D = np . array ( . . . ) where D . shape = ( N , M ) , in order to use a subset of
- Thus , given some data D = np . array ( . . . ) where D . shape = ( N , M ) , in order to use a subset of
it as , e . g . , imagePoints , one must effectively copy it into a new array : imagePoints =
it as , e . g . , imagePoints , one must effectively copy it into a new array : imagePoints =
np . ascontiguousarray ( D [ : , : 2 ] ) . reshape ( ( N , 1 , 2 ) )
np . ascontiguousarray ( D [ : , : 2 ] ) . reshape ( ( N , 1 , 2 ) )
- The methods * * SOLVEPNP_DLS * * and * * SOLVEPNP_UPNP * * cannot be used as the current implementations are
- The methods @ ref SOLVEPNP_DLS and @ ref SOLVEPNP_UPNP cannot be used as the current implementations are
unstable and sometimes give completely wrong results . If you pass one of these two
unstable and sometimes give completely wrong results . If you pass one of these two
flags , * * SOLVEPNP_EPNP * * method will be used instead .
flags , @ ref SOLVEPNP_EPNP method will be used instead .
- The minimum number of points is 4 in the general case . In the case of * * SOLVEPNP_P3P * * and * * SOLVEPNP_AP3P * *
- The minimum number of points is 4 in the general case . In the case of @ ref SOLVEPNP_P3P and @ ref SOLVEPNP_AP3P
methods , it is required to use exactly 4 points ( the first 3 points are used to estimate all the solutions
methods , it is required to use exactly 4 points ( the first 3 points are used to estimate all the solutions
of the P3P problem , the last one is used to retain the best solution that minimizes the reprojection error ) .
of the P3P problem , the last one is used to retain the best solution that minimizes the reprojection error ) .
- With * * SOLVEPNP_ITERATIVE * * method and ` useExtrinsicGuess = true ` , the minimum number of points is 3 ( 3 points
- With @ ref SOLVEPNP_ITERATIVE method and ` useExtrinsicGuess = true ` , the minimum number of points is 3 ( 3 points
are sufficient to compute a pose but there are up to 4 solutions ) . The initial solution should be close to the
are sufficient to compute a pose but there are up to 4 solutions ) . The initial solution should be close to the
global solution to converge .
global solution to converge .
- With * * SOLVEPNP_IPPE * * input points must be > = 4 and object points must be coplanar .
- With @ ref SOLVEPNP_IPPE input points must be > = 4 and object points must be coplanar .
- With * * SOLVEPNP_IPPE_SQUARE * * this is a special case suitable for marker pose estimation .
- With @ ref SOLVEPNP_IPPE_SQUARE this is a special case suitable for marker pose estimation .
Number of input points must be 4. Object points must be defined in the following order :
Number of input points must be 4. Object points must be defined in the following order :
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 0 : [ - squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
- point 1 : [ squareLength / 2 , squareLength / 2 , 0 ]
@ -1448,13 +1448,13 @@ CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints,
( patternSize = cv : : Size ( points_per_row , points_per_colum ) = cv : : Size ( columns , rows ) ) .
( patternSize = cv : : Size ( points_per_row , points_per_colum ) = cv : : Size ( columns , rows ) ) .
@ param corners Output array of detected corners .
@ param corners Output array of detected corners .
@ param flags Various operation flags that can be zero or a combination of the following values :
@ param flags Various operation flags that can be zero or a combination of the following values :
- * * CALIB_CB_ADAPTIVE_THRESH * * Use adaptive thresholding to convert the image to black
- @ ref CALIB_CB_ADAPTIVE_THRESH Use adaptive thresholding to convert the image to black
and white , rather than a fixed threshold level ( computed from the average image brightness ) .
and white , rather than a fixed threshold level ( computed from the average image brightness ) .
- * * CALIB_CB_NORMALIZE_IMAGE * * Normalize the image gamma with equalizeHist before
- @ ref CALIB_CB_NORMALIZE_IMAGE Normalize the image gamma with equalizeHist before
applying fixed or adaptive thresholding .
applying fixed or adaptive thresholding .
- * * CALIB_CB_FILTER_QUADS * * Use additional criteria ( like contour area , perimeter ,
- @ ref CALIB_CB_FILTER_QUADS Use additional criteria ( like contour area , perimeter ,
square - like shape ) to filter out false quads extracted at the contour retrieval stage .
square - like shape ) to filter out false quads extracted at the contour retrieval stage .
- * * CALIB_CB_FAST_CHECK * * Run a fast check on the image that looks for chessboard corners ,
- @ ref CALIB_CB_FAST_CHECK Run a fast check on the image that looks for chessboard corners ,
and shortcut the call if none is found . This can drastically speed up the call in the
and shortcut the call if none is found . This can drastically speed up the call in the
degenerate condition when no chessboard is observed .
degenerate condition when no chessboard is observed .
@ -1665,9 +1665,9 @@ typedef CirclesGridFinderParameters CirclesGridFinderParameters2;
( patternSize = Size ( points_per_row , points_per_colum ) ) .
( patternSize = Size ( points_per_row , points_per_colum ) ) .
@ param centers output array of detected centers .
@ param centers output array of detected centers .
@ param flags various operation flags that can be one of the following values :
@ param flags various operation flags that can be one of the following values :
- * * CALIB_CB_SYMMETRIC_GRID * * uses symmetric pattern of circles .
- @ ref CALIB_CB_SYMMETRIC_GRID uses symmetric pattern of circles .
- * * CALIB_CB_ASYMMETRIC_GRID * * uses asymmetric pattern of circles .
- @ ref CALIB_CB_ASYMMETRIC_GRID uses asymmetric pattern of circles .
- * * CALIB_CB_CLUSTERING * * uses a special algorithm for grid detection . It is more robust to
- @ ref CALIB_CB_CLUSTERING uses a special algorithm for grid detection . It is more robust to
perspective distortions but much more sensitive to background clutter .
perspective distortions but much more sensitive to background clutter .
@ param blobDetector feature detector that finds blobs like dark circles on light background .
@ param blobDetector feature detector that finds blobs like dark circles on light background .
If ` blobDetector ` is NULL then ` image ` represents Point2f array of candidates .
If ` blobDetector ` is NULL then ` image ` represents Point2f array of candidates .
@ -1681,7 +1681,7 @@ row). Otherwise, if the function fails to find all the corners or reorder them,
Sample usage of detecting and drawing the centers of circles : :
Sample usage of detecting and drawing the centers of circles : :
@ code
@ code
Size patternsize ( 7 , 7 ) ; //number of centers
Size patternsize ( 7 , 7 ) ; //number of centers
Mat gray = . . . . ; //source image
Mat gray = . . . ; //source image
vector < Point2f > centers ; //this will be filled by the detected centers
vector < Point2f > centers ; //this will be filled by the detected centers
bool patternfound = findCirclesGrid ( gray , patternsize , centers ) ;
bool patternfound = findCirclesGrid ( gray , patternsize , centers ) ;
@ -1720,8 +1720,8 @@ respectively. In the old interface all the vectors of object points from differe
concatenated together .
concatenated together .
@ param imageSize Size of the image used only to initialize the camera intrinsic matrix .
@ param imageSize Size of the image used only to initialize the camera intrinsic matrix .
@ param cameraMatrix Input / output 3 x3 floating - point camera intrinsic matrix
@ param cameraMatrix Input / output 3 x3 floating - point camera intrinsic matrix
\ f $ \ cameramatrix { A } \ f $ . If CV \ _CALIB \ _USE \ _INTRINSIC \ _GUESS
\ f $ \ cameramatrix { A } \ f $ . If @ ref CALIB_USE_INTRINSIC _GUESS
and / or CALIB_FIX_ASPECT_RATIO are specified , some or all of fx , fy , cx , cy must be
and / or @ ref CALIB_FIX_ASPECT_RATIO are specified , some or all of fx , fy , cx , cy must be
initialized before calling the function .
initialized before calling the function .
@ param distCoeffs Input / output vector of distortion coefficients
@ param distCoeffs Input / output vector of distortion coefficients
\ f $ \ distcoeffs \ f $ .
\ f $ \ distcoeffs \ f $ .
@ -1744,40 +1744,40 @@ parameters. Order of deviations values: \f$(R_0, T_0, \dotsc , R_{M - 1}, T_{M -
the number of pattern views . \ f $ R_i , T_i \ f $ are concatenated 1 x3 vectors .
the number of pattern views . \ f $ R_i , T_i \ f $ are concatenated 1 x3 vectors .
@ param perViewErrors Output vector of the RMS re - projection error estimated for each pattern view .
@ param perViewErrors Output vector of the RMS re - projection error estimated for each pattern view .
@ param flags Different flags that may be zero or a combination of the following values :
@ param flags Different flags that may be zero or a combination of the following values :
- * * CALIB_USE_INTRINSIC_GUESS * * cameraMatrix contains valid initial values of
- @ ref CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
Note , that if intrinsic parameters are known , there is no need to use this function just to
Note , that if intrinsic parameters are known , there is no need to use this function just to
estimate extrinsic parameters . Use solvePnP instead .
estimate extrinsic parameters . Use solvePnP instead .
- * * CALIB_FIX_PRINCIPAL_POINT * * The principal point is not changed during the global
- @ ref CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global
optimization . It stays at the center or at a different location specified when
optimization . It stays at the center or at a different location specified when
CALIB_USE_INTRINSIC_GUESS is set too .
@ ref CALIB_USE_INTRINSIC_GUESS is set too .
- * * CALIB_FIX_ASPECT_RATIO * * The functions consider only fy as a free parameter . The
- @ ref CALIB_FIX_ASPECT_RATIO The functions consider only fy as a free parameter . The
ratio fx / fy stays the same as in the input cameraMatrix . When
ratio fx / fy stays the same as in the input cameraMatrix . When
CALIB_USE_INTRINSIC_GUESS is not set , the actual input values of fx and fy are
@ ref CALIB_USE_INTRINSIC_GUESS is not set , the actual input values of fx and fy are
ignored , only their ratio is computed and used further .
ignored , only their ratio is computed and used further .
- * * CALIB_ZERO_TANGENT_DIST * * Tangential distortion coefficients \ f $ ( p_1 , p_2 ) \ f $ are set
- @ ref CALIB_ZERO_TANGENT_DIST Tangential distortion coefficients \ f $ ( p_1 , p_2 ) \ f $ are set
to zeros and stay zero .
to zeros and stay zero .
- * * CALIB_FIX_K1 , . . . , CALIB_FIX_K6 * * The corresponding radial distortion
- @ ref CALIB_FIX_K1 , . . . , @ ref CALIB_FIX_K6 The corresponding radial distortion
coefficient is not changed during the optimization . If CALIB_USE_INTRINSIC_GUESS is
coefficient is not changed during the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is
set , the coefficient from the supplied distCoeffs matrix is used . Otherwise , it is set to 0.
set , the coefficient from the supplied distCoeffs matrix is used . Otherwise , it is set to 0.
- * * CALIB_RATIONAL_MODEL * * Coefficients k4 , k5 , and k6 are enabled . To provide the
- @ ref CALIB_RATIONAL_MODEL Coefficients k4 , k5 , and k6 are enabled . To provide the
backward compatibility , this extra flag should be explicitly specified to make the
backward compatibility , this extra flag should be explicitly specified to make the
calibration function use the rational model and return 8 coefficients . If the flag is not
calibration function use the rational model and return 8 coefficients . If the flag is not
set , the function computes and returns only 5 distortion coefficients .
set , the function computes and returns only 5 distortion coefficients .
- * * CALIB_THIN_PRISM_MODEL * * Coefficients s1 , s2 , s3 and s4 are enabled . To provide the
- @ ref CALIB_THIN_PRISM_MODEL Coefficients s1 , s2 , s3 and s4 are enabled . To provide the
backward compatibility , this extra flag should be explicitly specified to make the
backward compatibility , this extra flag should be explicitly specified to make the
calibration function use the thin prism model and return 12 coefficients . If the flag is not
calibration function use the thin prism model and return 12 coefficients . If the flag is not
set , the function computes and returns only 5 distortion coefficients .
set , the function computes and returns only 5 distortion coefficients .
- * * CALIB_FIX_S1_S2_S3_S4 * * The thin prism distortion coefficients are not changed during
- @ ref CALIB_FIX_S1_S2_S3_S4 The thin prism distortion coefficients are not changed during
the optimization . If CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
- * * CALIB_TILTED_MODEL * * Coefficients tauX and tauY are enabled . To provide the
- @ ref CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled . To provide the
backward compatibility , this extra flag should be explicitly specified to make the
backward compatibility , this extra flag should be explicitly specified to make the
calibration function use the tilted sensor model and return 14 coefficients . If the flag is not
calibration function use the tilted sensor model and return 14 coefficients . If the flag is not
set , the function computes and returns only 5 distortion coefficients .
set , the function computes and returns only 5 distortion coefficients .
- * * CALIB_FIX_TAUX_TAUY * * The coefficients of the tilted sensor model are not changed during
- @ ref CALIB_FIX_TAUX_TAUY The coefficients of the tilted sensor model are not changed during
the optimization . If CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
@ param criteria Termination criteria for the iterative optimization algorithm .
@ param criteria Termination criteria for the iterative optimization algorithm .
@ -1789,7 +1789,7 @@ points and their corresponding 2D projections in each view must be specified. Th
by using an object with known geometry and easily detectable feature points . Such an object is
by using an object with known geometry and easily detectable feature points . Such an object is
called a calibration rig or calibration pattern , and OpenCV has built - in support for a chessboard as
called a calibration rig or calibration pattern , and OpenCV has built - in support for a chessboard as
a calibration rig ( see @ ref findChessboardCorners ) . Currently , initialization of intrinsic
a calibration rig ( see @ ref findChessboardCorners ) . Currently , initialization of intrinsic
parameters ( when CALIB_USE_INTRINSIC_GUESS is not set ) is only implemented for planar calibration
parameters ( when @ ref CALIB_USE_INTRINSIC_GUESS is not set ) is only implemented for planar calibration
patterns ( where Z - coordinates of the object points must be all zeros ) . 3 D calibration rigs can also
patterns ( where Z - coordinates of the object points must be all zeros ) . 3 D calibration rigs can also
be used as long as initial cameraMatrix is provided .
be used as long as initial cameraMatrix is provided .
@ -1972,39 +1972,39 @@ second camera coordinate system.
@ param F Output fundamental matrix .
@ param F Output fundamental matrix .
@ param perViewErrors Output vector of the RMS re - projection error estimated for each pattern view .
@ param perViewErrors Output vector of the RMS re - projection error estimated for each pattern view .
@ param flags Different flags that may be zero or a combination of the following values :
@ param flags Different flags that may be zero or a combination of the following values :
- * * CALIB_FIX_INTRINSIC * * Fix cameraMatrix ? and distCoeffs ? so that only R , T , E , and F
- @ ref CALIB_FIX_INTRINSIC Fix cameraMatrix ? and distCoeffs ? so that only R , T , E , and F
matrices are estimated .
matrices are estimated .
- * * CALIB_USE_INTRINSIC_GUESS * * Optimize some or all of the intrinsic parameters
- @ ref CALIB_USE_INTRINSIC_GUESS Optimize some or all of the intrinsic parameters
according to the specified flags . Initial values are provided by the user .
according to the specified flags . Initial values are provided by the user .
- * * CALIB_USE_EXTRINSIC_GUESS * * R and T contain valid initial values that are optimized further .
- @ ref CALIB_USE_EXTRINSIC_GUESS R and T contain valid initial values that are optimized further .
Otherwise R and T are initialized to the median value of the pattern views ( each dimension separately ) .
Otherwise R and T are initialized to the median value of the pattern views ( each dimension separately ) .
- * * CALIB_FIX_PRINCIPAL_POINT * * Fix the principal points during the optimization .
- @ ref CALIB_FIX_PRINCIPAL_POINT Fix the principal points during the optimization .
- * * CALIB_FIX_FOCAL_LENGTH * * Fix \ f $ f ^ { ( j ) } _x \ f $ and \ f $ f ^ { ( j ) } _y \ f $ .
- @ ref CALIB_FIX_FOCAL_LENGTH Fix \ f $ f ^ { ( j ) } _x \ f $ and \ f $ f ^ { ( j ) } _y \ f $ .
- * * CALIB_FIX_ASPECT_RATIO * * Optimize \ f $ f ^ { ( j ) } _y \ f $ . Fix the ratio \ f $ f ^ { ( j ) } _x / f ^ { ( j ) } _y \ f $
- @ ref CALIB_FIX_ASPECT_RATIO Optimize \ f $ f ^ { ( j ) } _y \ f $ . Fix the ratio \ f $ f ^ { ( j ) } _x / f ^ { ( j ) } _y \ f $
.
.
- * * CALIB_SAME_FOCAL_LENGTH * * Enforce \ f $ f ^ { ( 0 ) } _x = f ^ { ( 1 ) } _x \ f $ and \ f $ f ^ { ( 0 ) } _y = f ^ { ( 1 ) } _y \ f $ .
- @ ref CALIB_SAME_FOCAL_LENGTH Enforce \ f $ f ^ { ( 0 ) } _x = f ^ { ( 1 ) } _x \ f $ and \ f $ f ^ { ( 0 ) } _y = f ^ { ( 1 ) } _y \ f $ .
- * * CALIB_ZERO_TANGENT_DIST * * Set tangential distortion coefficients for each camera to
- @ ref CALIB_ZERO_TANGENT_DIST Set tangential distortion coefficients for each camera to
zeros and fix there .
zeros and fix there .
- * * CALIB_FIX_K1 , . . . , CALIB_FIX_K6 * * Do not change the corresponding radial
- @ ref CALIB_FIX_K1 , . . . , @ ref CALIB_FIX_K6 Do not change the corresponding radial
distortion coefficient during the optimization . If CALIB_USE_INTRINSIC_GUESS is set ,
distortion coefficient during the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is set ,
the coefficient from the supplied distCoeffs matrix is used . Otherwise , it is set to 0.
the coefficient from the supplied distCoeffs matrix is used . Otherwise , it is set to 0.
- * * CALIB_RATIONAL_MODEL * * Enable coefficients k4 , k5 , and k6 . To provide the backward
- @ ref CALIB_RATIONAL_MODEL Enable coefficients k4 , k5 , and k6 . To provide the backward
compatibility , this extra flag should be explicitly specified to make the calibration
compatibility , this extra flag should be explicitly specified to make the calibration
function use the rational model and return 8 coefficients . If the flag is not set , the
function use the rational model and return 8 coefficients . If the flag is not set , the
function computes and returns only 5 distortion coefficients .
function computes and returns only 5 distortion coefficients .
- * * CALIB_THIN_PRISM_MODEL * * Coefficients s1 , s2 , s3 and s4 are enabled . To provide the
- @ ref CALIB_THIN_PRISM_MODEL Coefficients s1 , s2 , s3 and s4 are enabled . To provide the
backward compatibility , this extra flag should be explicitly specified to make the
backward compatibility , this extra flag should be explicitly specified to make the
calibration function use the thin prism model and return 12 coefficients . If the flag is not
calibration function use the thin prism model and return 12 coefficients . If the flag is not
set , the function computes and returns only 5 distortion coefficients .
set , the function computes and returns only 5 distortion coefficients .
- * * CALIB_FIX_S1_S2_S3_S4 * * The thin prism distortion coefficients are not changed during
- @ ref CALIB_FIX_S1_S2_S3_S4 The thin prism distortion coefficients are not changed during
the optimization . If CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
- * * CALIB_TILTED_MODEL * * Coefficients tauX and tauY are enabled . To provide the
- @ ref CALIB_TILTED_MODEL Coefficients tauX and tauY are enabled . To provide the
backward compatibility , this extra flag should be explicitly specified to make the
backward compatibility , this extra flag should be explicitly specified to make the
calibration function use the tilted sensor model and return 14 coefficients . If the flag is not
calibration function use the tilted sensor model and return 14 coefficients . If the flag is not
set , the function computes and returns only 5 distortion coefficients .
set , the function computes and returns only 5 distortion coefficients .
- * * CALIB_FIX_TAUX_TAUY * * The coefficients of the tilted sensor model are not changed during
- @ ref CALIB_FIX_TAUX_TAUY The coefficients of the tilted sensor model are not changed during
the optimization . If CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
the optimization . If @ ref CALIB_USE_INTRINSIC_GUESS is set , the coefficient from the
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
supplied distCoeffs matrix is used . Otherwise , it is set to 0.
@ param criteria Termination criteria for the iterative optimization algorithm .
@ param criteria Termination criteria for the iterative optimization algorithm .
@ -2052,10 +2052,10 @@ Besides the stereo-related information, the function can also perform a full cal
the two cameras . However , due to the high dimensionality of the parameter space and noise in the
the two cameras . However , due to the high dimensionality of the parameter space and noise in the
input data , the function can diverge from the correct solution . If the intrinsic parameters can be
input data , the function can diverge from the correct solution . If the intrinsic parameters can be
estimated with high accuracy for each of the cameras individually ( for example , using
estimated with high accuracy for each of the cameras individually ( for example , using
calibrateCamera ) , you are recommended to do so and then pass CALIB_FIX_INTRINSIC flag to the
calibrateCamera ) , you are recommended to do so and then pass @ ref CALIB_FIX_INTRINSIC flag to the
function along with the computed intrinsic parameters . Otherwise , if all the parameters are
function along with the computed intrinsic parameters . Otherwise , if all the parameters are
estimated at once , it makes sense to restrict some parameters , for example , pass
estimated at once , it makes sense to restrict some parameters , for example , pass
CALIB_SAME_FOCAL_LENGTH and CALIB_ZERO_TANGENT_DIST flags , which is usually a
@ ref CALIB_SAME_FOCAL_LENGTH and @ ref CALIB_ZERO_TANGENT_DIST flags , which is usually a
reasonable assumption .
reasonable assumption .
Similarly to calibrateCamera , the function minimizes the total re - projection error for all the
Similarly to calibrateCamera , the function minimizes the total re - projection error for all the
@ -2105,7 +2105,7 @@ rectified first camera's image.
camera , i . e . it projects points given in the rectified first camera coordinate system into the
camera , i . e . it projects points given in the rectified first camera coordinate system into the
rectified second camera ' s image .
rectified second camera ' s image .
@ param Q Output \ f $ 4 \ times 4 \ f $ disparity - to - depth mapping matrix ( see @ ref reprojectImageTo3D ) .
@ param Q Output \ f $ 4 \ times 4 \ f $ disparity - to - depth mapping matrix ( see @ ref reprojectImageTo3D ) .
@ param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set ,
@ param flags Operation flags that may be zero or @ ref CALIB_ZERO_DISPARITY . If the flag is set ,
the function makes the principal points of each camera have the same pixel coordinates in the
the function makes the principal points of each camera have the same pixel coordinates in the
rectified views . And if the flag is not set , the function may still shift the images in the
rectified views . And if the flag is not set , the function may still shift the images in the
horizontal or vertical direction ( depending on the orientation of epipolar lines ) to maximize the
horizontal or vertical direction ( depending on the orientation of epipolar lines ) to maximize the
@ -2152,7 +2152,7 @@ coordinates. The function distinguishes the following two cases:
\ end { bmatrix } , \ f ]
\ end { bmatrix } , \ f ]
where \ f $ T_x \ f $ is a horizontal shift between the cameras and \ f $ cx_1 = cx_2 \ f $ if
where \ f $ T_x \ f $ is a horizontal shift between the cameras and \ f $ cx_1 = cx_2 \ f $ if
CALIB_ZERO_DISPARITY is set .
@ ref CALIB_ZERO_DISPARITY is set .
- * * Vertical stereo * * : the first and the second camera views are shifted relative to each other
- * * Vertical stereo * * : the first and the second camera views are shifted relative to each other
mainly in the vertical direction ( and probably a bit in the horizontal direction too ) . The epipolar
mainly in the vertical direction ( and probably a bit in the horizontal direction too ) . The epipolar
@ -2171,7 +2171,7 @@ coordinates. The function distinguishes the following two cases:
\ end { bmatrix } , \ f ]
\ end { bmatrix } , \ f ]
where \ f $ T_y \ f $ is a vertical shift between the cameras and \ f $ cy_1 = cy_2 \ f $ if
where \ f $ T_y \ f $ is a vertical shift between the cameras and \ f $ cy_1 = cy_2 \ f $ if
CALIB_ZERO_DISPARITY is set .
@ ref CALIB_ZERO_DISPARITY is set .
As you can see , the first three columns of P1 and P2 will effectively be the new " rectified " camera
As you can see , the first three columns of P1 and P2 will effectively be the new " rectified " camera
matrices . The matrices , together with R1 and R2 , can then be passed to initUndistortRectifyMap to
matrices . The matrices , together with R1 and R2 , can then be passed to initUndistortRectifyMap to
@ -2680,8 +2680,8 @@ same camera intrinsic matrix. If this assumption does not hold for your use case
to normalized image coordinates , which are valid for the identity camera intrinsic matrix . When
to normalized image coordinates , which are valid for the identity camera intrinsic matrix . When
passing these coordinates , pass the identity matrix for this parameter .
passing these coordinates , pass the identity matrix for this parameter .
@ param method Method for computing an essential matrix .
@ param method Method for computing an essential matrix .
- * * RANSAC * * for the RANSAC algorithm .
- @ ref RANSAC for the RANSAC algorithm .
- * * LMEDS * * for the LMedS algorithm .
- @ ref LMEDS for the LMedS algorithm .
@ param prob Parameter used for the RANSAC or LMedS methods only . It specifies a desirable level of
@ param prob Parameter used for the RANSAC or LMedS methods only . It specifies a desirable level of
confidence ( probability ) that the estimated matrix is correct .
confidence ( probability ) that the estimated matrix is correct .
@ param threshold Parameter used for RANSAC . It is the maximum distance from a point to an epipolar
@ param threshold Parameter used for RANSAC . It is the maximum distance from a point to an epipolar
@ -2713,8 +2713,8 @@ be floating-point (single or double precision).
are feature points from cameras with same focal length and principal point .
are feature points from cameras with same focal length and principal point .
@ param pp principal point of the camera .
@ param pp principal point of the camera .
@ param method Method for computing a fundamental matrix .
@ param method Method for computing a fundamental matrix .
- * * RANSAC * * for the RANSAC algorithm .
- @ ref RANSAC for the RANSAC algorithm .
- * * LMEDS * * for the LMedS algorithm .
- @ ref LMEDS for the LMedS algorithm .
@ param threshold Parameter used for RANSAC . It is the maximum distance from a point to an epipolar
@ param threshold Parameter used for RANSAC . It is the maximum distance from a point to an epipolar
line in pixels , beyond which the point is considered an outlier and is not used for computing the
line in pixels , beyond which the point is considered an outlier and is not used for computing the
final fundamental matrix . It can be set to something like 1 - 3 , depending on the accuracy of the
final fundamental matrix . It can be set to something like 1 - 3 , depending on the accuracy of the
@ -3221,8 +3221,8 @@ b_2\\
@ param to Second input 2 D point set containing \ f $ ( x , y ) \ f $ .
@ param to Second input 2 D point set containing \ f $ ( x , y ) \ f $ .
@ param inliers Output vector indicating which points are inliers ( 1 - inlier , 0 - outlier ) .
@ param inliers Output vector indicating which points are inliers ( 1 - inlier , 0 - outlier ) .
@ param method Robust method used to compute transformation . The following methods are possible :
@ param method Robust method used to compute transformation . The following methods are possible :
- cv : : RANSAC - RANSAC - based robust method
- @ ref RANSAC - RANSAC - based robust method
- cv : : LMEDS - Least - Median robust method
- @ ref LMEDS - Least - Median robust method
RANSAC is the default method .
RANSAC is the default method .
@ param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider
@ param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider
a point as an inlier . Applies only to RANSAC .
a point as an inlier . Applies only to RANSAC .
@ -3271,8 +3271,8 @@ two 2D point sets.
@ param to Second input 2 D point set .
@ param to Second input 2 D point set .
@ param inliers Output vector indicating which points are inliers .
@ param inliers Output vector indicating which points are inliers .
@ param method Robust method used to compute transformation . The following methods are possible :
@ param method Robust method used to compute transformation . The following methods are possible :
- cv : : RANSAC - RANSAC - based robust method
- @ ref RANSAC - RANSAC - based robust method
- cv : : LMEDS - Least - Median robust method
- @ ref LMEDS - Least - Median robust method
RANSAC is the default method .
RANSAC is the default method .
@ param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider
@ param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider
a point as an inlier . Applies only to RANSAC .
a point as an inlier . Applies only to RANSAC .
@ -3772,7 +3772,8 @@ namespace fisheye
CALIB_FIX_K3 = 1 < < 6 ,
CALIB_FIX_K3 = 1 < < 6 ,
CALIB_FIX_K4 = 1 < < 7 ,
CALIB_FIX_K4 = 1 < < 7 ,
CALIB_FIX_INTRINSIC = 1 < < 8 ,
CALIB_FIX_INTRINSIC = 1 < < 8 ,
CALIB_FIX_PRINCIPAL_POINT = 1 < < 9
CALIB_FIX_PRINCIPAL_POINT = 1 < < 9 ,
CALIB_ZERO_DISPARITY = 1 < < 10
} ;
} ;
/** @brief Projects points using fisheye model
/** @brief Projects points using fisheye model
@ -3905,7 +3906,7 @@ namespace fisheye
@ param image_size Size of the image used only to initialize the camera intrinsic matrix .
@ param image_size Size of the image used only to initialize the camera intrinsic matrix .
@ param K Output 3 x3 floating - point camera intrinsic matrix
@ param K Output 3 x3 floating - point camera intrinsic matrix
\ f $ \ cameramatrix { A } \ f $ . If
\ f $ \ cameramatrix { A } \ f $ . If
fisheye : : CALIB_USE_INTRINSIC_GUESS / is specified , some or all of fx , fy , cx , cy must be
@ ref fisheye : : CALIB_USE_INTRINSIC_GUESS is specified , some or all of fx , fy , cx , cy must be
initialized before calling the function .
initialized before calling the function .
@ param D Output vector of distortion coefficients \ f $ \ distcoeffsfisheye \ f $ .
@ param D Output vector of distortion coefficients \ f $ \ distcoeffsfisheye \ f $ .
@ param rvecs Output vector of rotation vectors ( see Rodrigues ) estimated for each pattern view .
@ param rvecs Output vector of rotation vectors ( see Rodrigues ) estimated for each pattern view .
@ -3915,17 +3916,17 @@ namespace fisheye
position of the calibration pattern in the k - th pattern view ( k = 0. . * M * - 1 ) .
position of the calibration pattern in the k - th pattern view ( k = 0. . * M * - 1 ) .
@ param tvecs Output vector of translation vectors estimated for each pattern view .
@ param tvecs Output vector of translation vectors estimated for each pattern view .
@ param flags Different flags that may be zero or a combination of the following values :
@ param flags Different flags that may be zero or a combination of the following values :
- * * fisheye : : CALIB_USE_INTRINSIC_GUESS * * cameraMatrix contains valid initial values of
- @ ref fisheye : : CALIB_USE_INTRINSIC_GUESS cameraMatrix contains valid initial values of
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
- * * fisheye : : CALIB_RECOMPUTE_EXTRINSIC * * Extrinsic will be recomputed after each iteration
- @ ref fisheye : : CALIB_RECOMPUTE_EXTRINSIC Extrinsic will be recomputed after each iteration
of intrinsic optimization .
of intrinsic optimization .
- * * fisheye : : CALIB_CHECK_COND * * The functions will check validity of condition number .
- @ ref fisheye : : CALIB_CHECK_COND The functions will check validity of condition number .
- * * fisheye : : CALIB_FIX_SKEW * * Skew coefficient ( alpha ) is set to zero and stay zero .
- @ ref fisheye : : CALIB_FIX_SKEW Skew coefficient ( alpha ) is set to zero and stay zero .
- * * fisheye : : CALIB_FIX_K1 . . fisheye : : CALIB_FIX_K4 * * Selected distortion coefficients
- @ ref fisheye : : CALIB_FIX_K1 , . . . , @ ref fisheye : : CALIB_FIX_K4 Selected distortion coefficients
are set to zeros and stay zero .
are set to zeros and stay zero .
- * * fisheye : : CALIB_FIX_PRINCIPAL_POINT * * The principal point is not changed during the global
- @ ref fisheye : : CALIB_FIX_PRINCIPAL_POINT The principal point is not changed during the global
optimization . It stays at the center or at a different location specified when CALIB_USE_INTRINSIC_GUESS is set too .
optimization . It stays at the center or at a different location specified when @ ref fisheye : : CALIB_USE_INTRINSIC_GUESS is set too .
@ param criteria Termination criteria for the iterative optimization algorithm .
@ param criteria Termination criteria for the iterative optimization algorithm .
*/
*/
CV_EXPORTS_W double calibrate ( InputArrayOfArrays objectPoints , InputArrayOfArrays imagePoints , const Size & image_size ,
CV_EXPORTS_W double calibrate ( InputArrayOfArrays objectPoints , InputArrayOfArrays imagePoints , const Size & image_size ,
@ -3949,7 +3950,7 @@ optimization. It stays at the center or at a different location specified when C
@ param P2 Output 3 x4 projection matrix in the new ( rectified ) coordinate systems for the second
@ param P2 Output 3 x4 projection matrix in the new ( rectified ) coordinate systems for the second
camera .
camera .
@ param Q Output \ f $ 4 \ times 4 \ f $ disparity - to - depth mapping matrix ( see reprojectImageTo3D ) .
@ param Q Output \ f $ 4 \ times 4 \ f $ disparity - to - depth mapping matrix ( see reprojectImageTo3D ) .
@ param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set ,
@ param flags Operation flags that may be zero or @ ref fisheye : : CALIB_ZERO_DISPARITY . If the flag is set ,
the function makes the principal points of each camera have the same pixel coordinates in the
the function makes the principal points of each camera have the same pixel coordinates in the
rectified views . And if the flag is not set , the function may still shift the images in the
rectified views . And if the flag is not set , the function may still shift the images in the
horizontal or vertical direction ( depending on the orientation of epipolar lines ) to maximize the
horizontal or vertical direction ( depending on the orientation of epipolar lines ) to maximize the
@ -3975,7 +3976,7 @@ optimization. It stays at the center or at a different location specified when C
observed by the second camera .
observed by the second camera .
@ param K1 Input / output first camera intrinsic matrix :
@ param K1 Input / output first camera intrinsic matrix :
\ f $ \ vecthreethree { f_x ^ { ( j ) } } { 0 } { c_x ^ { ( j ) } } { 0 } { f_y ^ { ( j ) } } { c_y ^ { ( j ) } } { 0 } { 0 } { 1 } \ f $ , \ f $ j = 0 , \ , 1 \ f $ . If
\ f $ \ vecthreethree { f_x ^ { ( j ) } } { 0 } { c_x ^ { ( j ) } } { 0 } { f_y ^ { ( j ) } } { c_y ^ { ( j ) } } { 0 } { 0 } { 1 } \ f $ , \ f $ j = 0 , \ , 1 \ f $ . If
any of fisheye : : CALIB_USE_INTRINSIC_GUESS , fisheye : : CALIB_FIX_INTRINSIC are specified ,
any of @ ref fisheye : : CALIB_USE_INTRINSIC_GUESS , @ ref fisheye : : CALIB_FIX_INTRINSIC are specified ,
some or all of the matrix components must be initialized .
some or all of the matrix components must be initialized .
@ param D1 Input / output vector of distortion coefficients \ f $ \ distcoeffsfisheye \ f $ of 4 elements .
@ param D1 Input / output vector of distortion coefficients \ f $ \ distcoeffsfisheye \ f $ of 4 elements .
@ param K2 Input / output second camera intrinsic matrix . The parameter is similar to K1 .
@ param K2 Input / output second camera intrinsic matrix . The parameter is similar to K1 .
@ -3985,16 +3986,16 @@ optimization. It stays at the center or at a different location specified when C
@ param R Output rotation matrix between the 1 st and the 2 nd camera coordinate systems .
@ param R Output rotation matrix between the 1 st and the 2 nd camera coordinate systems .
@ param T Output translation vector between the coordinate systems of the cameras .
@ param T Output translation vector between the coordinate systems of the cameras .
@ param flags Different flags that may be zero or a combination of the following values :
@ param flags Different flags that may be zero or a combination of the following values :
- * * fisheye : : CALIB_FIX_INTRINSIC * * Fix K1 , K2 ? and D1 , D2 ? so that only R , T matrices
- @ ref fisheye : : CALIB_FIX_INTRINSIC Fix K1 , K2 ? and D1 , D2 ? so that only R , T matrices
are estimated .
are estimated .
- * * fisheye : : CALIB_USE_INTRINSIC_GUESS * * K1 , K2 contains valid initial values of
- @ ref fisheye : : CALIB_USE_INTRINSIC_GUESS K1 , K2 contains valid initial values of
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
fx , fy , cx , cy that are optimized further . Otherwise , ( cx , cy ) is initially set to the image
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
center ( imageSize is used ) , and focal distances are computed in a least - squares fashion .
- * * fisheye : : CALIB_RECOMPUTE_EXTRINSIC * * Extrinsic will be recomputed after each iteration
- @ ref fisheye : : CALIB_RECOMPUTE_EXTRINSIC Extrinsic will be recomputed after each iteration
of intrinsic optimization .
of intrinsic optimization .
- * * fisheye : : CALIB_CHECK_COND * * The functions will check validity of condition number .
- @ ref fisheye : : CALIB_CHECK_COND The functions will check validity of condition number .
- * * fisheye : : CALIB_FIX_SKEW * * Skew coefficient ( alpha ) is set to zero and stay zero .
- @ ref fisheye : : CALIB_FIX_SKEW Skew coefficient ( alpha ) is set to zero and stay zero .
- * * fisheye : : CALIB_FIX_K1 . .4 * * Selected distortion coefficients are set to zeros and stay
- @ ref fisheye : : CALIB_FIX_K1 , . . . , @ ref fisheye : : CALIB_FIX_K4 Selected distortion coefficients are set to zeros and stay
zero .
zero .
@ param criteria Termination criteria for the iterative optimization algorithm .
@ param criteria Termination criteria for the iterative optimization algorithm .
*/
*/