1

I'm using stereo vision to obtain 3D reconstruction. I'm using opencv library. I've implemented my code this way:

1) Stereo Calibration

2) undistort and Rectification of image pair

3) disparity map - using SGBM

4) 3D coordinates calculating depht map - unsing reprojectImageTo3D();

Results:

-Good disparity map, and good 3D reconstruction

-Bad 3D coordinates values, the distances don't corresponde to the reality.

The 3D distances, the distante between camera and object, have 10 mm error and increse with distance. I,ve used various baselines and i get always error. When i compare the extrinsic parameter, vector T, output of "stereoRectify" the baseline match. So i dont know where the problem is.

Can someone help me please, thanks in advance

CAlibration:

http://textuploader.com/ocxl http://textuploader.com/ocxm

filipe
  • 13
  • 3

1 Answers1

1

Ten mm error can be reasonable for stereo vision solutions, all depending of course on the sensor sensitivity, resolution, baseline and the distance to the object.

The increasing error with respect to the object's distance is also typical to the problem - the stereo correspondence essentially performs triangulation between the two video sensors to the object, and the larger the distance is the derivative of the angle between the video sensors to the object translates to larger distance on the depth axis, which means larger error. Good example is when the angle between the video sensors to the object is almost right, which means that any small positive error in estimating it will throw the estimated depth to infinity.

The architecture you selected looks good. You can try increasing the sensors resolution, or maybe dig in to the calibration process which has a lot of room for tuning in the openCV library - making sure only images taken with the chessboard being static are selected, choose higher variety of the different poses of the chessboard, adding images until the registration between the two images drops below the maximal error you can allow, etc.

YHyatt
  • 26
  • 3
  • Thank you for quickly reply. I'm already using higher resolution – filipe Oct 26 '14 at 21:47
  • Thank you for quickly reply. But the error I get is 10 cm instead of 10mm. that's why i am concerned. I'm already using higher resolution. 2 digital monochromatic genie M1280 (1280*1024). the photo calibration aquisition is already static. the chessboard was moved at 16 positions in space. I dont know what i should do in order to solve this problem – filipe Oct 26 '14 at 21:55
  • 10 cm for which object distance and what baseline? – YHyatt Oct 26 '14 at 22:00
  • Also, 16 positions of the chessboard means 16 images? That's usually not enough, you can easily go above 80 and even 100 and still see improvement. – YHyatt Oct 26 '14 at 22:02
  • yes, i mean 16 pairs of photos. 10cm error - 20cm object distance. baseline 7cm(already tried diferent baselines). I am going to try with more photos, but still i think the error is much bigger than should be. – filipe Oct 26 '14 at 22:08
  • Well - 10 cm error for 20 cm objects is plenty. Two points: 1. The stereo correspondence will fail for too close objects as the perspective between the two images can be very different. It is common to assume that the angle between the object to the two cameras should be smaller than 15 degrees to achieve similar correspondence - which for 7 cm base-line means about 50 cm distance. 2. Since your disparity disparity map and 3D reconstruction looks good, it's not reasonable that the correspondence or the calibration failed, so it's just the projection of the disparity to 3D that can fail. – YHyatt Oct 27 '14 at 08:54
  • YHyatt thanks for your reply.. i haven't solved the problem yet. the optical axis of the camereas are parallel as possible, so the angle between them is close to 0. i've tried several object distances, from 20 cm to 70 cm and the error increase with depth. I dont know what to do more. I'm going to put here my calibration code.. – filipe Nov 03 '14 at 19:29
  • Here is my calibration code: http://textuploader.com/ogov can someone tell me if am i doing something wrong? thanks in advance – filipe Nov 04 '14 at 02:11