简体   繁体   English

openCV立体声匹配算法(stereoBM和stereoSGBM)可以与垂直校正图像一起使用吗

[英]Can openCV stereo matching algorithms (stereoBM and stereoSGBM) work with verticaly rectified images

I am using opencv library to do stereo reconstruction. 我正在使用opencv库进行立体声重建。 I am testing the rectification and stereo matching currently. 我目前正在测试整流和立体声匹配。 I used stereoRectify function from the opencv 2.4.9 and i made it work fine. 我使用了opencv 2.4.9中的stereoRectify函数,并使其正常工作。 I used test data from this site : http://vision.middlebury.edu/mview/data/ They have images along with camera matrix, rotation and translation matrices. 我使用了来自以下站点的测试数据: http : //vision.middlebury.edu/mview/data/它们具有图像以及相机矩阵,旋转和平移矩阵。 The problem is that stereoRectify returns a vertically aligned images (Vertical stereo) so the epipolar lines are vertical. 问题在于,stereoRectify返回垂直对齐的图像(垂直立体声),因此对极线是垂直的。 I could not make stereoBM produce any good disparity image (tried a lot of parameter tuning), and I am not sure if it can work with vertical stereo. 我无法使stereoBM产生任何良好的视差图像(尝试了很多参数调整),而且我不确定它是否可以与垂直立体声一起使用。 Does anyone have similar experience with this? 有人对此有类似的经验吗? Is there a way (some parameter maybe?) to make stereoBM or stereoSGBM work with vertically rectified images? 是否有办法(可能有一些参数?)使stereoBM或stereoSGBM与垂直校正的图像一起使用?

Last time I checked the code neither StereoBM nor StereoSGBM supported vertical stereo pairs (the implementation assumes a horizontal stereo pair). 上一次我检查代码时,StereoBM或StereoSGBM均不支持垂直立体声对(该实现假定为水平立体声对)。 You can however rotate by 90 degrees your images so that they form a horizontal stereo pair. 但是,您可以将图像旋转90度,以便它们形成水平立体声对。 Then compute a disparity map with either method and rotate it by 90 degrees in the opposite direction so that you get a disparity map for your input vertical stereo pair. 然后使用任何一种方法计算视差图,然后将其沿相反方向旋转90度,以便获得输入垂直立体声对的视差图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM