I'm using 'estimateUncalibratedRectification' and 'rectifiStereoImages' functions to rectify two images from left and right camera.
I firstly estimate the fundamental matrix by matched points from two images. Then use the matched points and fmatrix to estimate the transformation matrixs of two images for rectification.
After the rectification, the images seems to be cropped (with less size). I try to use transformation matrix (tform1) to transform the matched points in raw image 1 to rectified image 1 but failed as it is far from where it shoud be.
Can anybody tell me how to transform these 2D point coordinates after rectification?
Best regards,
Xicheng Wang
The main code is:
[fMatrix, inliers] = estimateFundamentalMatrix(mp1,mp2,'Method','Norm8Point');
[t1, t2] = estimateUncalibratedRectification(fMatrix, mp1(inliers,:), mp2(inliers,:), size(im1));
tform1 = projective2d(t1); % transformation matrix for image1 (right)
tform2 = projective2d(t2); % transformation matrix for image2 (left)
[im1_Rect, im2_Rect] = rectifyStereoImages(im1,im2,tform1,tform2); % rectfiy the images
% Transform the points from raw image to rectified image
[mp1_Rect(:,1),mp1_Rect(:,2)] = transformPointsForward(tform1,mp1(:,1),mp1(:,2));