[Bug集合]OpenCV Error: Assertion failed ((type == CV_8U && dtype == CV_32S) || dtype == CV_32F)

转自:https://blog.csdn.net/qq_33591712/article/details/83050019

在做视觉里程计时,之间套用高博slam14讲的方法时报错:
OpenCV Error: Assertion failed ((type == CV_8U && dtype == CV_32S) || dtype == CV_32F) in batchDistance
原因:Since SIFT and SURF return a detectorType() of CV32F (=float) you cannot use any Hamming-distance as matcher. Hamming-distance works only for binary feature-types like ORB, FREAK, … I guess it would be possible if you’d convert them to CV8U. Afaik for SIFT this should be fairly easy since they are actually already normalized for the range 0-255 (double check that before you do it). However, I doubt that this is useful at all, use L2 norm for those and you should be fine.
orb描述子深度是CV_8U,可以用汉明距离的,而sift,surf,为CV32F直接套用汉明匹配则报错。

使用特征提取过程得到的特征描述符(descriptor)数据类型有的是float类型的,比如说SurfDescriptorExtractor,SiftDescriptorExtractor,有的是uchar类型的,比如说有ORB,BriefDescriptorExtractor。

对应float类型的匹配方式有:FlannBasedMatcher,BruteForce<L2>,BruteForce<SL2>,BruteForce<L1>。

对应uchar类型的匹配方式有:BruteForce,BruteForce。所以ORB和BRIEF特征描述子只能使用BruteForce匹配法。
 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值