确认两个:

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/

相关文章:

  • 2021-10-12
  • 2022-12-23
  • 2021-11-04
  • 2022-01-04
  • 2022-01-05
  • 2021-10-02
  • 2022-02-13
  • 2021-08-13
猜你喜欢
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2021-11-01
  • 2021-05-25
  • 2021-09-02
  • 2022-12-23
相关资源
相似解决方案