OpenCV 3D reconstruction using shipped images and examples

不想你离开。 提交于 2019-12-23 01:37:16

问题


I am trying to perform a 3D surface reconstruction from a stereo configuration with OpenCV example files. I have created a stereo camera from 2 web cams. I have obtained the calibration parameters using stereo_calib.cpp ( https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/stereo_calib.cpp?rev=4086 ) and generated a point cloud with stereo_match.cpp ( https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/c/stereo_match.cpp?rev=2614 ). The resulting point cloud, opened with MeshLab doesn't resemble the original scene at all ( http://img707.imageshack.us/i/snapshot01u.png/ ).

What am I missing here?

Steps to recreate:

  1. stereo_calib.cpp (on the same folder where the images are, with no arguments so it assumes default)

  2. stereo_match left01.jpg right01.jpg -i intrinsics.yml -e extrinsics.yml -p cloud.asc

  3. import cloud.asc on MeshLab

Thanks


回答1:


The description and the image you've posted do not give a lot of information. But from my experience with 3D reconstruction it seem to be that the extrinsic or intrinsic parameters are not correct.

Thus, something had gone wrong with your calibration. You have to get the intrinsic calibration of both cameras and the extrinsic between your cameras.

  1. The extrinsic parameters represent the relative position and orientation between the cameras. Thus, if they are incorrect anything can happen, mostly the point cloud is extremely degenerated.
  2. The intrinsic parameters describe how the 3D points are projected onto the 2D image. Thus, if you have incorrect intrinsic parameters your point cloud is deformed with a linear transformation (assumed that there is a negligible radial/tangential distortion or distortion of a higher order, respectively).

There is a lot of good literature covering the topic of 3D reconstruction and stereo. One of the most important of them is the book "Multiple View Geometry" from Richard Hartley and Andrew Zisserman.



来源:https://stackoverflow.com/questions/5794311/opencv-3d-reconstruction-using-shipped-images-and-examples

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!