Ask Your Question

problem with Orb matching

asked 2012-10-18 06:03:41 -0600

andrea gravatar image

updated 2012-10-18 06:05:40 -0600

Hi to all! i try to use Orb feature for object detection... i use this code:

int numKeyPoints = 200;
std::vector<KeyPoint> keypoints_1,keypoints_2;
OrbFeatureDetector detector(numKeyPoints);
detector.detect( img_1, keypoints_1 );
detector.detect( img_2, keypoints_2 );
OrbDescriptorExtractor extractor;
Mat descriptors_1,descriptors_2;
extractor.compute( img_1, keypoints_1, descriptors_1 );
extractor.compute( img_2, keypoints_2, descriptors_2 );
BFMatcher matcher(Hamming);
std::vector< DMatch > matches;
matcher.match( descriptor_1, descriptor_2, matches );

but i have this error:

request for member 'match' in 'matcher', which is of non-class type 'cv::BFMatcher ()(cv::Hamming)'

I don't understand where is the error....


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-10-18 11:56:01 -0600

Vladislav Vinogradov gravatar image

You should create matcher with NORM_HAMMING parameter

BFMatcher matcher(NORM_HAMMING);

Hamming is a type name, so compiler thinks that

BFMatcher matcher(Hamming);

is a function declaration. The function has one parameter with Hamming type and returns BFMatcher object.

edit flag offensive delete link more

Question Tools


Asked: 2012-10-18 06:03:41 -0600

Seen: 1,276 times

Last updated: Oct 18 '12