Ask Your Question

Revision history [back]

Algorithm used in Descriptor Matcher trainer in OpenCV

The code snippet below shows the basics of training a descriptor matcher used in object recognition.

detector = cv.FeatureDetector('ORB');
extractor = cv.DescriptorExtractor('ORB');
matcher = cv.DescriptorMatcher('BruteForce-Hamming')

for(i=1 to N)
{
   detector(i) = detector.detect(image(i));
   descriptor(i) = extractor.compute(image(i),detector(i));
   matcher.add(descriptor(i));

}
matcher.train();

The code is not syntactically correct, however I want to know how the train() function of matcher works here.