MATLAB: Recitfy Images before triangulate points

computer visionComputer Vision Toolboxrectify imagesstereo visiontriangulate

Hello, I have a question regarding the new triangulate function. I have 2 almost parallel cameras and would like to run a triangulation of certain points in the image. Do i have to rectify these images before extracting the matching points or do I extract the points of the original image?
Thank you

Best Answer

The matlab function uses the cameramatrix and undistorted images. So you should not use both of the image. You should create first a undistorted image.
uImage1 = undistortImage(Image1,stereoParams.CameraParameters1);
uImage2 = undistortImage(Image2,stereoParams.CameraParameters2);
point3d = triangulate(pointImage1, pointImage2, stereoParams);