mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Merge pull request #26669 from GouMinghao:4.x
solvePnPRansac implementation for Fisheye camera model #26669 Related: https://github.com/opencv/opencv/pull/25028 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -4075,6 +4075,40 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \
|
||||
the provided rvec and tvec values as initial approximations of the rotation and translation
|
||||
vectors, respectively, and further optimizes them.
|
||||
@param flags Method for solving a PnP problem: see @ref calib3d_solvePnP_flags
|
||||
@param criteria Termination criteria for internal undistortPoints call.
|
||||
The function interally undistorts points with @ref undistortPoints and call @ref cv::solvePnP,
|
||||
thus the input are very similar. More information about Perspective-n-Points is described in @ref calib3d_solvePnP
|
||||
for more information.
|
||||
*/
|
||||
CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,
|
||||
InputArray cameraMatrix, InputArray distCoeffs,
|
||||
OutputArray rvec, OutputArray tvec,
|
||||
bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE,
|
||||
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8)
|
||||
);
|
||||
|
||||
/**
|
||||
@brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme for fisheye camera moodel.
|
||||
|
||||
@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or
|
||||
1xN/Nx1 3-channel, where N is the number of points. vector\<Point3d\> can be also passed here.
|
||||
@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,
|
||||
where N is the number of points. vector\<Point2d\> can be also passed here.
|
||||
@param cameraMatrix Input camera intrinsic matrix \f$\cameramatrix{A}\f$ .
|
||||
@param distCoeffs Input vector of distortion coefficients (4x1/1x4).
|
||||
@param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec, brings points from
|
||||
the model coordinate system to the camera coordinate system.
|
||||
@param tvec Output translation vector.
|
||||
@param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses
|
||||
the provided rvec and tvec values as initial approximations of the rotation and translation
|
||||
vectors, respectively, and further optimizes them.
|
||||
@param iterationsCount Number of iterations.
|
||||
@param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value
|
||||
is the maximum allowed distance between the observed and computed point projections to consider it
|
||||
an inlier.
|
||||
@param confidence The probability that the algorithm produces a useful result.
|
||||
@param inliers Output vector that contains indices of inliers in objectPoints and imagePoints .
|
||||
@param flags Method for solving a PnP problem: see @ref calib3d_solvePnP_flags
|
||||
This function returns the rotation and the translation vectors that transform a 3D point expressed in the object
|
||||
coordinate frame to the camera coordinate frame, using different methods:
|
||||
- P3P methods (@ref SOLVEPNP_P3P, @ref SOLVEPNP_AP3P): need 4 input points to return a unique solution.
|
||||
@@ -4091,12 +4125,14 @@ optimization. It is the \f$max(width,height)/\pi\f$ or the provided \f$f_x\f$, \
|
||||
thus the input are very similar. More information about Perspective-n-Points is described in @ref calib3d_solvePnP
|
||||
for more information.
|
||||
*/
|
||||
CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints,
|
||||
InputArray cameraMatrix, InputArray distCoeffs,
|
||||
OutputArray rvec, OutputArray tvec,
|
||||
bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE,
|
||||
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8)
|
||||
);
|
||||
CV_EXPORTS_W bool 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,
|
||||
TermCriteria criteria = TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 10, 1e-8)
|
||||
);
|
||||
|
||||
//! @} calib3d_fisheye
|
||||
} // end namespace fisheye
|
||||
|
||||
Reference in New Issue
Block a user