cv.recoverPose - MATLAB File Help
cv.recoverPose

Recover relative camera rotation and translation from an estimated essential matrix and the corresponding points in two images, using cheirality check

[R, t, good] = cv.recoverPose(E, points1, points2)
[R, t, good, mask, triangulatedPoints] = cv.recoverPose(...)
[...] = cv.recoverPose(..., 'OptionName', optionValue, ...)

Input

Output

Options

This function decomposes an essential matrix using cv.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. Some details can be found in [Nister03].

This function can be used to process output E and mask from cv.findEssentialMat. In this scenario, points1 and points2 are the same input for cv.findEssentialMat.

Example

% Estimation of fundamental matrix using the RANSAC algorithm
point_count = 100;
points1 = cell(1, point_count);
points2 = cell(1, point_count);
% initialize the points here ...
for i=1:point_count
    points1{i} = ...;  % [x,y]
    points2{i} = ...;  % [x,y]
end

% cametra matrix with both focal lengths = 1, and principal point = [0 0]
cameraMatrix = eye(3,3);

[E, mask] = cv.findEssentialMat(points1, points2, ...
    'CameraMatrix',cameraMatrix, 'Method','Ransac');
[R, t, ~, mask] = cv.recoverPose(E, points1, points2, ...
    'CameraMatrix',cameraMatrix, 'Mask',mask);

References

[Nister03]:

David Nister. "An efficient solution to the five-point relative pose problem". Pattern Analysis and Machine Intelligence, IEEE Transactions on, 26(6):756-770, 2004.

See also