Ask Your Question

Revision history [back]

click to hide/show revision 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?).

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).