# Revision history [back]

The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, eg textured object detection. So usually vector 'descriptors' consists from several matrices of descriptors according to training images count. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors,
const Mat& tenter code hererainDescriptors, vector<dmatch>& matches, const Mat& mask=Mat() )  
 2 No.2 Revision Kirill Kornyakov 2762 ●13 ●24 ●52

The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, eg textured object detection. So usually vector 'descriptors' consists from several matrices of descriptors according to training images count. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors,
const Mat& tenter code hererainDescriptors, trainDescriptors, vector<dmatch>& matches, const Mat& mask=Mat() )  
 3 No.3 Revision Kirill Kornyakov 2762 ●13 ●24 ●52

The typical scenario of using the DescriptorMatcher::add DescriptorMatcher::add method is matching to descriptors from several images, eg textured e.g. "textured object detection. detection", where you have several views of the same 3D object. So usually vector 'descriptors' descriptors consists from of several matrices of descriptors according to the number of training images count. images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors,
const Mat& trainDescriptors, vector<dmatch>& matches, const Mat& mask=Mat() )  

Usually you don't want to train matcher for only one image :) The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, e.g. "textured object detection", where you have several views of the same 3D object. So usually vector descriptors consists of several matrices of descriptors according to the number of training images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors,  const Mat& trainDescriptors, vector<dmatch>& vector<DMatch>& matches, const Mat& mask=Mat() ) )


instead of sequence add(), train(), match(). BTW you can not to call train() manually, it will be called in the first call of match().

But if you have to add descriptors from trainig set of images by one, you can write

descriptorMatcher.add(vector(1, currentImageDescriptors));


Usually you don't want to train matcher for only one image :) The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, e.g. "textured object detection", where you have several views of the same 3D object. So usually vector descriptors consists of several matrices of descriptors according to the number of training images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors, const Mat& trainDescriptors, vector<DMatch>& matches, const Mat& mask=Mat() )


instead of sequence add(), train(), match(). BTW you can not to call train() manually, it will be called in the first call of match().

But if you have to add descriptors from trainig set of images by one, you can write

descriptorMatcher.add(vector(1, currentImageDescriptors));


I think it's also elegant way.

Usually you don't want to train matcher for only one image :) The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, e.g. "textured object detection", where you have several views of the same 3D object. detection". So usually vector descriptors consists of several matrices of descriptors according to the number of training images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors, const Mat& trainDescriptors, vector<DMatch>& matches, const Mat& mask=Mat() )


instead of sequence add(), train(), match(). BTW you can not to call train() manually, it will be called in the first call of match().

But if you have to add descriptors from trainig set of images by one, you can write

descriptorMatcher.add(vector(1, currentImageDescriptors));


I think it's also elegant way.

 7 No.7 Revision Kirill Kornyakov 2762 ●13 ●24 ●52

Usually you don't want to train matcher for only one image :) The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, e.g. "textured object detection". So usually vector descriptors consists of several matrices of descriptors according to the number of training images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors, const Mat& trainDescriptors, trainDescriptors,
vector<DMatch>& matches, const Mat& mask=Mat() )


instead of sequence add(), train(), match(). BTW you can not to call train() manually, it will be called in the first call of match().

But if you have to add descriptors from trainig set of images by one, you can write

descriptorMatcher.add(vector(1, currentImageDescriptors));


I think it's also elegant way.

Usually you don't want to train matcher for only one image :) The typical scenario of using the DescriptorMatcher::add method is matching to descriptors from several images, e.g. "textured object detection". So usually vector descriptors consists of several matrices of descriptors according to the number of training images. If you want to match with descriptors of only one image, the easiest way is to use

void DescriptorMatcher::match( const Mat& queryDescriptors, const Mat& trainDescriptors,
vector<DMatch>& matches, const Mat& mask=Mat() )


instead of sequence add(), train(), match(). BTW you can not to call train() manually, it will be called in the first call of match().

But if you have to add descriptors from trainig set of images by one, you can write

descriptorMatcher.add(vector(1, descriptorMatcher.add(vector<Mat>(1, currentImageDescriptors));


I think it's also elegant way.