RGBDSLAM 问题解决:create’ is not a member of ‘cv::FeatureDetector {aka cv::Feature2D}’ detecto

转自:https://blog.csdn.net/wuliyanyan/article/details/55805238?locationNum=4&fps=1

1、detectFeatures.cpp:37:16: error: ‘create’ is not a member of ‘cv::FeatureDetector {aka cv::Feature2D}’
     detector = cv::FeatureDetector::create("ORB");

出现这个问题的主要原因是opencv版本不同,针对3.0以后的版本,特征提取器的声明方式有变化:

detector = cv::ORB::create();具体的参数可以源码查阅


2、detectFeatures.cpp.o:在函数‘main’中:
detectFeatures.cpp:(.text+0xfb1):对‘point2dTo3d(cv::Point3_<float>&, CAMERA_INTRINSIC_PARAMETERS&)’未定义的引用

在CmakeLists文件里面添加对slambase的依赖;


ADD_EXECUTABLE( detectFeatures detectFeatures.cpp )
TARGET_LINK_LIBRARIES( detectFeatures 
slambase
${OpenCV_LIBS} 
    ${PCL_LIBRARIES} )


3、OpenCV Error: Assertion failed (confidence > 0 && confidence < 1) in run, file /home/limz/Cmake_module/opencv-3.2.0/modules/calib3d/src/ptsetreg.cpp, line 178
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/limz/Cmake_module/opencv-3.2.0/modules/calib3d/src/ptsetreg.cpp:178: error: (-215) confidence > 0 && confidence < 1 in function run


已放弃 (核心已转储)

同样是由于opencv版本不同,而出现的问题,3.0以后对solvePnPRansac函数的定义进行类修正:

bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
                        InputArray _cameraMatrix, InputArray _distCoeffs,
                        OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess,
                        int iterationsCount, float reprojectionError, double confidence,
                        OutputArray _inliers, int flags)

增加了confidence:算法产生有用结果的置信系数

具体函数的学习可以参考这篇博客: 

opencv中solvePnPRansac函数求解相机位姿

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值