本文介绍了cvReprojectImageTo3D -3d 建模从 2d 图像问题-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常需要你的帮助来解决这个问题.我正在尝试用 2d 图像在 3d 中建模一个简单的场景.我正在使用 2 张图像(左和右 - 著名的筑波场景)http://www.cc.gatech.edu/classes/AY2003/cs7495_fall/ProblemSets/Data/tsukuba-right.bmp我得到了一个视差图.像这个.http://www.robots.ox.ac.uk/~ojw/2op/tsukuba_score.png

i need your help about this issue badly. i am trying to model a simple scene in 3d out of 2d images. i am using 2 images (left and right-the famous tsukuba scene)http://www.cc.gatech.edu/classes/AY2003/cs7495_fall/ProblemSets/Data/tsukuba-right.bmpi get a disparity map. like this one.http://www.robots.ox.ac.uk/~ojw/2op/tsukuba_score.png

在这里我有一些问题.我认为步骤应该是:

after here i have some questions. i think the steps should be:

cvStereoRectify(得到Q)cvReprojectImageTo3D(视差图,3dimage,Q)

cvStereoRectify ( to get Q)cvReprojectImageTo3D (disparity map, 3dimage , Q )

但我不知道在stereoRectify中作为输入传递什么我只有2张图像,我没有任何关于相机的信息.(也许我可以改用stereoRectifyUncalibrated,如果可以,我该怎么做?)

but i dont know what to pass as inputs in stereoRectify i only have 2 images,i dont have any info about cameras. (maybe i can use stereoRectifyUncalibrated instead, if so how do i?)

请帮忙谢谢

推荐答案

从 opencv 文档中提取:

" 函数stereoRectify 计算每个相机的旋转矩阵(实际上)使两个相机图像平面成为同一平面.因此,这使所有极线平行,从而简化了密集立体对应问题.在输入时,该函数采用由stereoCalibrate() 计算的矩阵并在输出时在新坐标中给出2 个旋转矩阵和2 个投影矩阵.

" The function stereoRectify computes the rotation matrices for each camera that (virtually) make both camera image planes the same plane. Consequently, that makes all the epipolar lines parallel and thus simplifies the dense stereo correspondence problem. On input the function takes the matrices computed by stereoCalibrate() and on output it gives 2 rotation matrices and also 2 projection matrices in the new coordinates. "

答案:

这意味着 3 个选项:

It means 3 options :

  • 或者你有两个图像并且你知道你从 XML 加载的相机模型(intrisics),例如 loadXMLFromFile() =>stereoRectify() => reprojectImageTo3D()

或者你没有它们但你可以校准你的相机 => stereoCalibrate() =>stereoRectify() => reprojectImageTo3D()

Or you don't have them but you can calibrate your camera => stereoCalibrate() => stereoRectify() => reprojectImageTo3D()

或者您无法校准相机(这是您的情况,因为您没有筑波爵士的相机,那么:您需要使用 SURF、SIFT 在两个图像上找到对关键点,例如(您实际上可以使用任何blob检测器),然后计算这些关键点的描述符,然后根据它们的描述符匹配右图和左图的关键点,然后从中找到基本垫.处理要困难得多,如下所示:检测关键点(SURF、SIFT)=> 提取描述符(SURF、SIFT)=> 比较和匹配描述符(基于BruteForce、Flann 的方法)=> 从这些对中找到基本垫(findFundamentalMat())=>stereoRectifyUncalibrated() => reprojectImageTo3D()

Or you can't calibrate the camera (it is your case, because you don't have the Sir Tsukuba's camera, then : you need to find pair keypoints on both images with SURF, SIFT for instance (you can use any blob detector actually), then compute descriptors of these keypoints, then matching keypoints from image right and image left according to their descriptors, and then find the fundamental mat from them. The processing is much harder and would be like this: detect keypoints (SURF, SIFT) => extract descriptors (SURF,SIFT) => compare and match descriptors (BruteForce, Flann based approaches) => find fundamental mat (findFundamentalMat()) from these pairs => stereoRectifyUncalibrated() => reprojectImageTo3D()

希望对你有帮助,如果没有,请告诉我

I hope it helped you, if not, please, let me know

朱利安

这篇关于cvReprojectImageTo3D -3d 建模从 2d 图像问题-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 00:35