Compute relative rotation and translation between camera poses
[
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
, ___)
You can compute the camera extrinsics, rotationMatrix
and translationVector
,
corresponding to the camera pose, from relativeOrientation
and relativeLocation
:
[rotationMatrix,translationVector] = cameraPoseToExtrinsics(relativeOrientation,relativeLocation)
eye(3)
,
and its location is, [0,0,0]
.You can then use rotationMatrix
and translationVector
as
inputs to the cameraMatrix
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
uses inlierPoints1
and inlierPoints2
to
determine the realizable combination.
Camera Calibrator | cameraMatrix
| cameraPoseToExtrinsics
| estimateCameraParameters
| estimateEssentialMatrix
| estimateFundamentalMatrix
| estimateWorldCameraPose
| plotCamera
| triangulate
| triangulateMultiview