Ask Your Question

Coordinates and 3D reconstruction after stereoCalibration

asked 2017-03-20 13:15:22 -0500

Jim H gravatar image

updated 2017-03-21 17:48:47 -0500

Tetragramm gravatar image

I am new to OpenCV stereovision and several questions after running the sample stereo_calib.cpp using the sample leftImage and rightImage pairs:

  1. I have tried to reconstruct 3D points using the image pairs for calibration: imagePoints[0] and imagePoints[1]. We should be able to get a point cloud in the 3D object space consisting of corners in all board orientations. what's the procedure to do this?
  2. Some documents said we need to rectify the two images first, then find the matching feature like corners. Because we already have matched image pairs (distorted) that are used for calibration, I do not want to run matching again and just want to use the image pairs for 3D reconstruction. I also try to avoid remapping the entire images to save image processing time. to do this, first thing is to understand what in rmap matrix. After "initUndistortRectifyMap(cameraMatrix[0], distCoeffs[0], R1, P1, imageSize, CV_16SC2, rmap[0][0], rmap[0][1])" at line 278 and 279, rmap[0][0] has 3.15 MB while rmap[0][1] has 1.61 MB. From openCV document, one mapping is for Y and one map for X, then they should be the same size. Why do they have different size? how to use them without using remap() function?
  3. Where is the origin of the 3D object coordinate system located after stereo calibration? Thanks, Jim
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-03-22 03:00:59 -0500

LBerger gravatar image

updated 2017-03-22 03:02:12 -0500

About 1 you can use triangulate method (you need to undistort points)

About initUndistortRectifyMap first map is 2d map and second a 1D map. First is x,y mapping and I think second map is an interpolation map

you can find explanation in 2.4 docor 3.2 doc

About coordinate system see StereoCalibrate :

R   Output rotation matrix between the 1st and the 2nd camera coordinate systems.

Coordinate system is described in Detailed Description of calib3d module (sorry there is no link to detail description available)

You can try example in opencv stereomatch and stereocalib and stereobm

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-03-20 13:15:22 -0500

Seen: 21 times

Last updated: yesterday