Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find 3d position of a point with intrinsic and extrinsic parameters with opencv

i want to find a position of a point with opencv. i calibrated two cameras using cvCalibrateCamera2. so i know both intrinsic and extrinsic parameters. I read that with a known intrinsic and extrinsic parameters, i can reconstruct 3d by triangulation easily. Is there a function in opencv to achive this.I think cvProjectPoint2 may be useful but i don t understand what exactly. So how i can find 3d position of a point.

Thanks.

like image 410
cemal inanç Avatar asked Nov 25 '10 20:11

cemal inanç


1 Answers

You first have to find disparities. There are two algorithms implemented in OpenCV - block matching (cvFindStereoCorrespondenceBM) and graph cuts (cvFindStereoCorrespondenceGC). The latter one gives better results but is slower. After disparity detection you can reproject the disparities to 3D using cvReprojectImageTo3D. This gives you distances for each point of the input images that is in both camera views.

Also note that the stereo correspondence algorithms require a rectified image pair (use cvStereoRectify, cvInitUndistortRectifyMap and cvRemap).

like image 122
Karel Petranek Avatar answered Oct 23 '22 03:10

Karel Petranek