Table of Contents

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

E InputArray

The input essential matrix.

points1 InputArray

Array of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).

points2 InputArray

Array of the second image points of the same size and format as points1.

cameraMatrix InputArray

Camera matrix K=⎡⎣⎢fx000fy0cxcy1⎤⎦⎥ . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix.

R OutputArray

Recovered relative rotation.

t OutputArray

Recovered relative translation.

mask InputOutputArray

Input/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

int

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

E InputArray

The input essential matrix.

points1 InputArray

Array of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).

points2 InputArray

Array of the second image points of the same size and format as points1.

R OutputArray

Recovered relative rotation.

t OutputArray

Recovered relative translation.

focal double

Focal 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.

pp Point2d

principal point of the camera.

mask InputOutputArray

Input/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

int

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

E InputArray

The input essential matrix.

points1 InputArray

Array of N 2D points from the first image. The point coordinates should be floating-point (single or double precision).

points2 InputArray

Array of the second image points of the same size and format as points1.

cameraMatrix InputArray

Camera matrix K=⎡⎣⎢fx000fy0cxcy1⎤⎦⎥ . Note that this function assumes that points1 and points2 are feature points from cameras with the same camera matrix.

R OutputArray

Recovered relative rotation.

t OutputArray

Recovered relative translation.

distanceTresh double

threshold distance which is used to filter out far away points (i.e. infinite points).

mask InputOutputArray

Input/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.

triangulatedPoints OutputArray

3d points which were reconstructed by triangulation.

Returns

int