3
votes

Ive implemented a stereo pipeline in Matlab multiple times, and now I am trying to implement one in OpenCV. Ive been following Martin Peris's reconstruction: http://blog.martinperis.com/2012/01/3d-reconstruction-with-opencv-and-point.html

When implementing with Matlab, my pipeline goes like this: calibration -> rectification -> stereo matching -> unrectify/unwarp matches -> triangulate matches.

In OpenCV, the pipeline goes like this calibration -> rectification -> stereo matching -> reprojectTo3D

with the reprojectTo3D function here: http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#void%20reprojectImageTo3D%28InputArray%20disparity,%20OutputArray%20_3dImage,%20InputArray%20Q,%20bool%20handleMissingValues,%20int%20ddepth%29

Is it not doing triangulation? How is this possible? Is it assuming the cameras are in a canonical setup and parallel already?

1

1 Answers

2
votes

OpenCV pipeline gets a disparity map for triangulation from stereo matching, and the projection matrices of the cameras from calibration and rectification steps. You could use triangualtePoints with positions of points viewed from both cameras and their projection matrices from stereoRectify function. The main algorithm is the same, You just use slightly different intermediate products.