Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

[Features2D] implementation differences of different Features Detectors/Extractors/Matchers

Hello, i'm testing images matching with Feature Detectors, Extractors and Matchers. I've found a problem when i try to use OrbFeatures. I'l try to explain.

If i use SURF in this way:

SurfFeatureDetector detector;
SurfDescriptorExtractor extractor;
BFMatcher matcher; //or Flann, not relevant
[...]//features detection and extraction here both for object and scene
std::vector< Mat > descriptors;
descriptors.push_back(descriptors_object);
matcher.clear();
matcher.add(descriptors);
matcher.train();
matcher.match( descriptors_scene, matches);

And then i print the DMatches this way:

//match is cycled through all the matches
printf("-- Match trainIdx, queryIdx, distance: %d, %d, %f \n", match.queryIdx, match.trainIdx, match.distance );

The result are matches ordered by trainIdx.

But when i use ORB this way:

OrbFeatureDetector detector;
OrbDescriptorExtractor extractor;
BFMatcher matcher;
[...]//features detection and extraction here both for object and scene
std::vector< Mat > descriptors;
descriptors.push_back(descriptors_object);
matcher.clear();
matcher.add(descriptors);
matcher.train();
matcher.match( descriptors_scene, matches);

Then i print the results same way, the matches are ordered by queryIdx!

The problem is not the matches order, but it seems that ORB results are not correct, like if the matcher takes every feature from the scene image (query) and try to find the most similar feature in the object image (train), opposite to the SURF case in which it seems that the matcher takes every feature from from the object image (train) and try to find the most similar feature in the scene image (query).