OpenCV Error: Assertion failed (data0.dims <= 2 && type == 5 && K > 0) in cv::kmeans 

报错:

数据类型不对,转换一下就可以了。 all_descriptors .convertTo(all_descriptors, CV_32F);

加入在 Mat vocabulary = bowTrainer.cluster(allDescriptors); 之前就可以了

allDescriptors.convertTo(allDescriptors, CV_32F);

BOWKMeansTrainer bowTrainer(wordCount, tc, retries, flags);
Mat vocabulary = bowTrainer.cluster(allDescriptors);

相关文章:

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