Hi Antariksha,
The warning you are getting may indicate a corrupt image file. By the way, when you capture your calibration images, please save them in a format that uses lossless compression, like PNG or BMP. JPEG's compression is lossy, which introduces artifacts into the image, which affect calibration accuracy.
The error you are getting from rectifyStereoImages indicates that the function cannot compute the size of the output image. This indicates a problem with your calibration. Try the following:
J = undistortImage(I1, stereoParams.CameraParameters1, 'OutputView', 'full');
imshow(J);
I expect that you will see a very strange image, kind of folded upon itself.
If you used 3 radial distortion coefficients for your calibration, try re-calibrating using only 2. Also, try capturing more calibration images with the checkerboard closer to the edges and corners of the frame. Also, make sure that the checkerboard is in various 3D orientations, tilted and slanted in different ways.
Best Answer