relativeCameraPose
(Not recommended) Calculate relative rotation and translation between camera poses
relativeCameraPose
is not recommended. Use the estrelpose
function instead. For more information, see Version History.
Syntax
Description
[
returns the orientation and location of a calibrated camera relative to its previous
pose. The two poses are related by relativeOrientation
,relativeLocation
]
= relativeCameraPose(M
,cameraParams
,inlierPoints1
,inlierPoints2
)M
, which must be a
fundamental, essential, affine2d
, or projective2d
matrix. The function
computes the camera location up to scale and returns
relativeLocation
as a unit vector.
[
returns the orientation and location of the second camera relative to the first
one.relativeOrientation
,relativeLocation
]
= relativeCameraPose(M
,cameraParams1
,cameraParams2
,inlierPoints1
,inlierPoints2
)
[
additionally returns the fraction of the inlier points that project in front of both
cameras.relativeOrientation
,relativeLocation
,validPointsFraction
]
= relativeCameraPose(M
, ___)
Input Arguments
Output Arguments
Tips
You can compute the camera extrinsics,
rotationMatrix
andtranslationVector
, corresponding to the camera pose, fromrelativeOrientation
andrelativeLocation
:The orientation of the previous camera pose is the identity matrix,[rotationMatrix,translationVector] = cameraPoseToExtrinsics(relativeOrientation,relativeLocation)
eye(3)
, and its location is,[0,0,0]
.You can then use
rotationMatrix
andtranslationVector
as inputs to thecameraMatrix
function.You can compute four possible combinations of orientation and location from the input fundamental matrix. Three of the combinations are not physically realizable, because they project 3-D points behind one or both cameras. The
relativeCameraPose
function usesinlierPoints1
andinlierPoints2
to determine the realizable combination.