欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

BUG(跑SLAM14-ch12)

程序员文章站 2024-03-25 08:09:10
...

error1: no matching function for call to ‘cv::ORB::create()’
Ptr< Feature2D > detector = ORB::create();

^

// Ptr< Feature2D > detector = ORB::create();此为原代码
     Ptr<Feature2D> detector = Feature2D::create ( "ORB" );

参考:https://blog.csdn.net/LittleEmperor/article/details/79698579
备注:Feature2D包含特征检测、描述、匹配等2D特征框架

error2: ‘class cv::Feature2D’ has no member named ‘detectAndCompute’ detector->detectAndComp

 // detector->detectAndCompute( image, Mat(), keypoints, descriptor );此为原代码
        detector->detect( image, keypoints );
        detector->compute( image, keypoints, descriptor );

参考:
cv::Feature2D Class Reference
https://*.com/questions/33332055/opencv-how-to-create-a-descriptorextractor-object
https://*.com/questions/52725621/how-to-align-2-images-with-opencv-with-orb-fail-to-compile
感觉像是版本问题,没有找到这个函数,故把这个函数拆开来运行,成功!