使用提供的图像和示例进行 OpenCV 3D 重建

发布于 2024-11-03 04:56:37 字数 963 浏览 4 评论 0原文

我正在尝试使用 OpenCV 示例文件从立体配置执行 3D 表面重建。我用 2 个网络摄像头创建了一个立体摄像头。 我已经使用stereo_calib.cpp( https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/stereo_calib.cpp?rev=4086 )并使用stereo_match生成点云。 .cpp(https://code.ros.org /trac/opencv/browser/trunk/opencv/samples/c/stereo_match.cpp?rev=2614 )。使用 MeshLab 打开的结果点云根本不像原始场景 ( http:// img707.imageshack.us/i/snapshot01u.png/ )。

我在这里缺少什么?

重新创建的步骤:

  1. stereo_calib.cpp(在图像所在的同一文件夹中,没有参数,因此假定为默认值)

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

  3. 在 MeshLab 上导入 cloud.asc

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千紇 2024-11-10 04:56:37

您发布的描述和图像没有提供太多信息。但根据我的 3D 重建经验,外部或内部参数似乎不正确。

因此,您的校准出了问题。您必须获得两个相机的内在校准以及相机之间的外部校准。

  1. 外部参数表示相机之间的相对位置和方向。因此,如果它们不正确,任何事情都可能发生,大多数点云都会极度退化。
  2. 内在参数描述了 3D 点如何投影到 2D 图像上。因此,如果您的内在参数不正确,您的点云会通过线性变换而变形(假设分别存在可忽略的径向/切向畸变或更高阶的畸变)。

有很多涉及 3D 重建和立体主题的优秀文献。其中最重要的一本是“多视图几何”一书理查德·哈特利和安德鲁·齐瑟曼。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文