Ask Your Question
0

stereo rectify incorrect result

asked 2013-08-13 03:44:15 -0600

pandaren gravatar image

Hi i am new to computer vision and also to opencv.

I am trying to rectify a stereo images with the following workflow:

  1. Calibrate left and right camera with "calibrateCamera" on both images.
  2. "stereoCalibrate" using the camera matrix and distortion coeff found in the previous step as the input (fix intrinsic flag)
  3. "stereoRectify" using the camera matrix, distortion coeff, rotation- and translation-matrix from the previous step.
  4. "initUndistortRectifyMap" using the output from previous steps
  5. "remap" using the output from previous step

After remap I got a weird result, the images are not rectified at all. These are the images I used:

  1. img1.PNG
  2. img2.PNG

These are the result:

  1. result1.png
  2. result2.png

I think I made a basic mistake but I don't know what. Could anyone clarify me?

Thank you in advance!

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-08-14 13:35:31 -0600

If you pay attention those images seem rectified!

If you put both pictures of the result side by side, and draw a line from the points in the image on he right to the one in the left you have straight lines.

here are some good resources on this: http://blog.martinperis.com/search/label/Computer%20Vision http://shop.oreilly.com/product/9780596516130.do

edit flag offensive delete link more
1

answered 2013-08-14 18:00:53 -0600

As pbodymind pointed out, those images seem rectified, at least the part corresponding to the inside of the chessboard. But according to your description, you are using only that one pair of stereo images for calibration, aren't you? (That would explain why the squares on the chessboard are perfectly aligned on the undistorted images, but the borders of the paper sheet seem to be bent)

Using only one pair of stereo images for calibration is not enough, to get a good calibration you need to take many pictures of the same chessboard in as many different positions and orientations as possible.

The resources mentioned by pbodymind will help you to understand better stereo calibration.

Good luck!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-08-13 03:44:15 -0600

Seen: 1,919 times

Last updated: Aug 14 '13