首页 > 其他 > 详细

OpenCV Error: Assertion failed (queryDescriptors.type() == trainDescCollection[0].type()) in knnMatchImpl,

时间:2019-04-28 17:08:04      阅读:295      评论:0      收藏:0      [点我收藏+]

确认两个:

1、图像是灰度的

// Read in the image

Mat img = imread(entryPath.string(), 1);

cvtColor(img, img, CV_BGR2GRAY);

2、描述子要是CV_8UC1形式的(在之前用描述子形成词袋时,描述子格式有转换为CV_32F过)。

cv::Mat dictionary = bowTrainer.cluster();

cv::Mat uDictionary;

dictionary.convertTo(uDictionary, CV_8UC1);

bowDE.setVocabulary(uDictionary);

仍然有疑惑详见:https://answers.opencv.org/question/17460/how-to-use-bag-of-words-example-with-brief-descriptors/

OpenCV Error: Assertion failed (queryDescriptors.type() == trainDescCollection[0].type()) in knnMatchImpl,

原文:https://www.cnblogs.com/rjjhyj/p/10784929.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!