Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you CANNOT use binary descriptors, like ORB,BRISK or BRIEF with BoW, it's only possible with float descriptors like SIFT,SURF or KAZE.

you probably tried to "cheat" by converting the descriptors to float for the BowKMeansTrainer, but think of it: it does not make any sense to convert bitstrings to float for kmeans clustering, they simply do not represent numbers.

to use ORB or similar, it would need KMajority or KMedian clustering, not implemented in opencv.

again, if you want to use a "free" descriptor for this, try again with KAZE (and the FlannBasedMatcher)

you CANNOT use binary descriptors, like ORB,BRISK or BRIEF with BoW, it's only possible with float descriptors like SIFT,SURF or KAZE.

descriptors = np.float32(descriptors)

you probably tried to "cheat" here, by converting the descriptors to float for the BowKMeansTrainer, but think of it: it does not make any sense to convert bitstrings to float for kmeans clustering, they simply do not represent numbers.

this also leads to the error you get, the train descriptors don't have the same type as your test descriptors

to use ORB or similar, it would need KMajority or KMedian clustering, not implemented in opencv.

again, if you want to use a "free" descriptor for this, try again with KAZE (and the FlannBasedMatcher)

you CANNOT use binary descriptors, like ORB,BRISK or BRIEF with BoW, it's only possible with float descriptors like SIFT,SURF or KAZE.

descriptors = np.float32(descriptors)

you tried to "cheat" here, by converting the descriptors to float for the BowKMeansTrainer, but think of it: it does not make any sense to convert bitstrings to float for kmeans clustering, they simply do not represent numbers.numbers, that can be compared qith L2 distance.

this also leads to the error you get, the train descriptors don't have the same type as your test descriptors

to use ORB or similar, it would need KMajority or KMedian clustering, not implemented in opencv.

again, if you want to use a "free" descriptor for this, try again with KAZE (and the FlannBasedMatcher)

you CANNOT use binary descriptors, like ORB,BRISK or BRIEF with BoW, it's only possible with float descriptors like SIFT,SURF or KAZE.

descriptors = np.float32(descriptors)

you tried to "cheat" here, by converting the descriptors to float for the BowKMeansTrainer, but think of it: it does not make any sense to convert bitstrings to float for kmeans clustering, they simply do not represent numbers, that can be compared qith with L2 distance.

this also leads to the error you get, the train descriptors indeed don't have the same type as your test descriptors

to use ORB or similar, it would need KMajority or KMedian clustering, not implemented in opencv.

again, if you want to use a "free" descriptor for this, try again with KAZE (and the FlannBasedMatcher)