OpenCV Error: Assertion failed (data0.dims <= 2 && type == 5 && K > 0) in cv::kmeans spa
報錯:ip
數據類型不對,轉換一下就能夠了。 all_descriptors .convertTo(all_descriptors, CV_32F);io
加入在 Mat vocabulary = bowTrainer.cluster(allDescriptors); 以前就能夠了數據類型
allDescriptors.convertTo(allDescriptors, CV_32F);im
BOWKMeansTrainer bowTrainer(wordCount, tc, retries, flags);
Mat vocabulary = bowTrainer.cluster(allDescriptors);數據