Method RecoverPose
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
RecoverPose(InputArray, InputArray, InputArray, InputArray, OutputArray, OutputArray, InputOutputArray)
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.
public static int RecoverPose(InputArray E, InputArray points1, InputArray points2, InputArray cameraMatrix, OutputArray R, OutputArray t, InputOutputArray mask = default)
Parameters
EInputArrayThe input essential matrix.
points1InputArrayArray of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image points of the same size and format as points1.
cameraMatrixInputArrayCamera matrix K=⎡⎣⎢fx000fy0cxcy1⎤⎦⎥ . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix.
ROutputArrayRecovered relative rotation.
tOutputArrayRecovered relative translation.
maskInputOutputArrayInput/output mask for inliers in points1 and points2. : If it is not empty, then it marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to recover pose. In the output mask only inliers which pass the cheirality check. This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible pose hypotheses by doing cheirality check. The cheirality check basically means that the triangulated 3D points should have positive depth.
Returns
RecoverPose(InputArray, InputArray, InputArray, OutputArray, OutputArray, double, Point2d, InputOutputArray)
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.
public static int RecoverPose(InputArray E, InputArray points1, InputArray points2, OutputArray R, OutputArray t, double focal, Point2d pp, InputOutputArray mask = default)
Parameters
EInputArrayThe input essential matrix.
points1InputArrayArray of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image points of the same size and format as points1.
ROutputArrayRecovered relative rotation.
tOutputArrayRecovered relative translation.
focaldoubleFocal length of the camera. Note that this function assumes that points1 and points2 are feature points from cameras with same focal length and principal point.
ppPoint2dprincipal point of the camera.
maskInputOutputArrayInput/output mask for inliers in points1 and points2. : If it is not empty, then it marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to recover pose. In the output mask only inliers which pass the cheirality check. This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible pose hypotheses by doing cheirality check. The cheirality check basically means that the triangulated 3D points should have positive depth.
Returns
RecoverPose(InputArray, InputArray, InputArray, InputArray, OutputArray, OutputArray, double, InputOutputArray, OutputArray)
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.
public static int RecoverPose(InputArray E, InputArray points1, InputArray points2, InputArray cameraMatrix, OutputArray R, OutputArray t, double distanceTresh, InputOutputArray mask = default, OutputArray triangulatedPoints = default)
Parameters
EInputArrayThe input essential matrix.
points1InputArrayArray of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).
points2InputArrayArray of the second image points of the same size and format as points1.
cameraMatrixInputArrayCamera matrix K=⎡⎣⎢fx000fy0cxcy1⎤⎦⎥ . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix.
ROutputArrayRecovered relative rotation.
tOutputArrayRecovered relative translation.
distanceTreshdoublethreshold distance which is used to filter out far away points (i.e. infinite points).
maskInputOutputArrayInput/output mask for inliers in points1 and points2. : If it is not empty, then it marks inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to recover pose. In the output mask only inliers which pass the cheirality check. This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible pose hypotheses by doing cheirality check. The cheirality check basically means that the triangulated 3D points should have positive depth.
triangulatedPointsOutputArray3d points which were reconstructed by triangulation.