cv.stereoRectifyUncalibrated - MATLAB File Help |
Computes a rectification transform for an uncalibrated stereo camera
[H1,H2,success] = cv.stereoRectifyUncalibrated(points1, points2, F, imageSize)
[...] = cv.stereoRectifyUncalibrated(..., 'OptionName', optionValue, ...)
{[x1, y1], [x2, y2], ...}
or an Nx2/Nx1x2/1xNx2
numeric array. The same formats as in cv.findFundamentalMat are supported.points1
.[w,h]
.|points2{i}' * F * points1{i}| > Threshold
) are rejected prior to
computing the homographies. Otherwise, all the points are considered
inliers. default 5The function computes the rectification transformations without knowing
intrinsic parameters of the cameras and their relative position in the
space, which explains the suffix "uncalibrated". Another related difference
from cv.stereoRectify is that the function outputs not the rectification
transformations in the object (3D) space, but the planar perspective
transformations encoded by the homography matrices H1
and H2
. The
function implements the algorithm [Hartley99].
While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, it would be better to correct it before computing the fundamental matrix and calling this function. For example, distortion coefficients can be estimated for each head of stereo camera separately by using cv.calibrateCamera. Then, the images can be corrected using cv.undistort, or just the point coordinates can be corrected with cv.undistortPoints.
[Hartley99]:
Richard I Hartley. "Theory and practice of projective rectification". International Journal of Computer Vision, 35(2):115-127, 1999.