Computes the rectification transformations for 3-head camera, where all the heads are on the same line
S = cv.rectify3Collinear(cameraMatrix1, distCoeffs1, cameraMatrix2,
distCoeffs2, cameraMatrix3, distCoeffs3, imageSize, R12, T12, R13, T13)
[...] = cv.rectify3Collinear(..., 'OptionName', optionValue, ...)
Input
- cameraMatrix1 First camera matrix 3x3.
- distCoeffs1 First camera distortion parameters of 4, 5, 8, 12 or 14
elements.
- cameraMatrix2 Second camera matrix 3x3.
- distCoeffs2 Second camera distortion parameters of 4, 5, 8, 12 or 14
elements.
- cameraMatrix3 Third camera matrix 3x3.
- distCoeffs3 Third camera distortion parameters of 4, 5, 8, 12 or 14
elements.
- imageSize Size of the image used for stereo calibration
[w,h]
.
- R12 Rotation matrix between the coordinate systems of the first and the
second cameras, 3x3/3x1 (see cv.Rodrigues)
- T12 Translation vector between coordinate systems of the first and the
second cameras, 3x1.
- R13 Rotation matrix between the coordinate systems of the first and the
third cameras, 3x3/3x1 (see cv.Rodrigues)
- T13 Translation vector between coordinate systems of the first and the
third cameras, 3x1.
Output
- S scalar struct having the following fields:
- R1 3x3 rectification transform (rotation matrix) for the first
camera.
- R2 3x3 rectification transform (rotation matrix) for the second
camera.
- R3 3x3 rectification transform (rotation matrix) for the third
camera.
- P1 3x4 projection matrix in the new (rectified) coordinate
systems for the first camera.
- P2 3x4 projection matrix in the new (rectified) coordinate
systems for the second camera.
- P3 3x4 projection matrix in the new (rectified) coordinate
systems for the third camera.
- Q 4x4 disparity-to-depth mapping matrix (see
cv.reprojectImageTo3D).
- roi1, roi2 rectangles inside the rectified images where all
the pixels are valid
[x,y,w,h]
. If Alpha=0
, the ROIs cover
the whole images. Otherwise, they are likely to be smaller.
- ratio disparity ratio, floating-point numeric scalar.
Options
- ImgPoints1, ImgPoints3 Optional cell arrays of 2D points
{[x,y], ...}
, used to adjust the third matrix P3
.
Not set by default.
- Alpha Free scaling parameter. If it is -1 or absent, the function
performs the default scaling. Otherwise, the parameter should be
between 0 and 1.
Alpha=0
means that the rectified images are zoomed
and shifted so that only valid pixels are visible (no black areas
after rectification). Alpha=1
means that the rectified image is
decimated and shifted so that all the pixels from the original iamges
from the cameras are retained in the rectified images (no source image
pixels are lost). Obviously, any intermediate value yields an
intermediate result between those two extreme cases. default -1
- NewImageSize New image resolution after rectification. The same size
should be passed to cv.initUndistortRectifyMap. When [0,0] is passed
(default), it is set to the original
imageSize
. Setting it to larger
value can help you preserve details in the original image, especially
when there is a big radial distortion.
- ZeroDisparity If the flag is set, the function makes the principal
points of each camera have the same pixel coordinates in the rectified
views. And if the flag is not set, the function may still shift the
images in the horizontal or vertical direction (depending on the
orientation of epipolar lines) to maximize the useful image area.
default true.