首页 文章

在立体相机中的右图像上找到相应的2d点

提问于
浏览
2

我在立体相机的左图像中有一个点(xl,y1) . 我想确定右图像中相同点的位置,让我们说右图像中的点(xr,yr) . 我使用opencv使用相机校准来获得所有旋转矩阵和平移矩阵 .

1 回答

  • 2

    您可以使用简单的2D点匹配来完成此操作 . 我在OpenFrameworks中有这样的东西:

    cv::Ptr<cv::DescriptorExtractor> ext = cv::DescriptorExtractor::create("ORB");
    
    cv::Mat descriptors_1, descriptors_2;
    
    //The images are cv::Mat and the Points are std::vector<cv::KeyPoint>> which I got from cv::FASTX()
    ext->compute(_leftImage, _leftPoints, descriptors_1);
    ext->compute(_rightImage, _rightPoints, descriptors_2);
    
    cv::BFMatcher matcher;
    
    std::vector<cv::DMatches> matches;
    matcher.match(descriptors_1, descriptors_2, matches);
    

    matches 然后引用每个图像中的拟合点对 . 它仍然需要一些清理来摆脱异常值(所有正确的匹配应该彼此平行;)),但是通过一些工作,你应该能够将两个图像相互纠正 .

相关问题