rectifyStereoImages
Rectify a pair of stereo images
Description
[J1,J2]
= rectifyStereoImages(I1,I2,stereoParams) returns
undistorted and rectified versions of I1 and I2 input
images using the stereo parameters stored in the stereoParams object.
Stereo image rectification projects images onto a common image plane in such a way that the
corresponding points have the same row
coordinates. This image projection makes the image
appear as though the two cameras are parallel. Use
the disparityBM or disparitySGM functions to compute a
disparity map from the rectified images for 3-D
scene reconstruction.
[J1,J2]
= rectifyStereoImages(I1,I2,tform1,tform2) returns
rectified versions of I1 and I2 input
images by applying projective transformations tform1 and tform2.
The projective transformations are returned by the estimateUncalibratedRectification function.
[J1,J2]
= rectifyStereoImages(___,interp) additionally
specifies the interpolation method to use for rectified images. You
can specify the method as 'nearest', 'linear',
or 'cubic'.
[J1,J2]
= rectifyStereoImages(___,Name,Value) uses
additional options specified by one or more Name,Value pair
arguments.
Examples
Rectify Stereo Images
Specify images containing a checkerboard for calibration.
imageDir = fullfile(toolboxdir('vision'),'visiondata', ...
'calibration','stereo');
leftImages = imageDatastore(fullfile(imageDir,'left'));
rightImages = imageDatastore(fullfile(imageDir,'right'));
Detect the checkerboards.
[imagePoints,boardSize] = de