1 | initial version |
And this compiles? Actually these two lines:
std::vector<cv::KeyPoint> keypoints = detector.detect( img, keypoints);
cv::Mat img = cv::imread( *file, CV_LOAD_IMAGE_GRAYSCALE );
should be swapped.
The rest looks in principle fine, only that you should create one single dictionary, not for each class a separate dictionary. Otherwise it would be more difficult to measure a concrete distance between two resulting BoW descriptors (is that possible at all?).
2 | No.2 Revision |
And this compiles? Actually these two lines:
std::vector<cv::KeyPoint> keypoints = detector.detect( img, keypoints);
cv::Mat img = cv::imread( *file, CV_LOAD_IMAGE_GRAYSCALE );
should be swapped.
The rest looks in principle fine, only that you should create one single dictionary, not for each class a separate dictionary. Otherwise it would be more difficult to measure a concrete distance between two resulting BoW descriptors (is that possible at all?).
Regarding your error: Do you also use the same BoW-extraction? i.e. do you use 'dextract' with the other images as well? Maybe you used your 'extractor' (or another SURF-descriptor-extractor).