本文介绍了cvReprojectImageTo3D从2D图像-3D建模发出─的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我需要你的这个问题严重的帮助。我试图在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.pngi 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的DOC提取物:功能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个选项: 或者你有两个图像,你知道你的相机型号,你从一个XML加载实例(intrisics)的的 loadXMLFromFile()=> stereoRectify()=> reprojectImageTo3D()Or you have two images and you know the model of your camera (intrisics) that you loaded from a XML for instance loadXMLFromFile() => stereoRectify() => reprojectImageTo3D()或者你没有他们,但你可以校准相机=> stereoCalibrate()=> stereoRectify()=> reprojectImageTo3D()的Or you don't have them but you can calibrate your camera => stereoCalibrate() => stereoRectify() => reprojectImageTo3D()或您无法校准相机(这是你的情况,因为你没有在爵士筑波的相机,那么:你需要找到与SURF两幅图像对关键点,过筛,例如(您,可以使用任何BLOB检测实际上),然后计算这些关键点的描述,从肖像权和图像,然后匹配的关键点,根据他们的描述离开,然后从他们那里根本垫的处理是困难得多,会是这样:的检测从这些对=> stereoRectifyUncalibrated关键点(SURF,SIFT)=>提取描述符(SURF,SIFT)=>比较和匹配描述符(暴力破解,弗莱恩基础的方法)=>找到根本的垫子(findFundamentalMat()) ()=> 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从2D图像-3D建模发出─的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 22:43