Stereo-calibration -- Wrong output size of image
3 views (last 30 days)
Show older comments
Greetings,
I am using the stereo-calibration application of matlab and I have some troubling error. After I have put my 15 pairs of images and the chessboards were well recognized I tried to calibrate. The calibration goes well, but when I use the stereo parameters from the calibration, my images are croped from 2048*2048 pixels to 1918*1003. This way, there is no overlap of the two images when I try to make the disparity map. The cameras are seperated by 5.5cm. When I tried initially with my cameras seperated by 50cm, then the output size would be of 2700*8300 pixels, mostly black (and still not usable). I am working at 40-45cm distance.
My question is :
How can I get a satisfactory calibration of my cameras (Seeing that obviously the distance between the cameras seems to be very important) ?
Here are some screenshots of what the application gives me after the calibration :



And here are the images before/after rectification using the stereo parameters :


0 Comments
Answers (1)
Dima Lisin
on 8 Oct 2015
Try exporting the streoParameters object and doing the following:
[J1,J2]=rectifyStereoImages(I1,I2,stereoParams, 'OutputView', 'full');
2 Comments
Dima Lisin
on 8 Oct 2015
You have to be careful to have the right parameters when you call the disparity function. The most important one is 'DisparityRange'. Display the anaglyph using imtool, and use the ruler widget to measure the disparty for some pairs of matching points. That should give you the idea of what the 'DisparityRange' should be. The default is [0, 64], and that is unlikely to work in your case.
Once you compute the disparity, display it using imshow, and make sure that you can see the silhouettes of objects in your scene.
Another thing to keep in mind is that if your camera 1 is on the right, as you look in the same direction as the cameras, then the disparity will be negative. Then you must change the 'DisparityRange' accordingly, e.g. [-128, 0], or reverse camera 1 and camera 2 and recalibrate.
One more thing. In your calibration, you are getting high errors for image pairs 13 and 15. You should remove those and recalibrate.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!