How to find the best match using SURF OpenCV using C++? -
i'm using opencv c++, in vs2010 face recognition application. that, used surf, bruteforcematcher.
bfmatcher matcher; vector< dmatch > matches; //match: execute matcher! matcher.match(descriptors1,descriptors2, matches);
i want know happens when call method. gesture "matches" vector filled matching key points.
and
is there anyway can use "matches" vector find matches?
currently, i'm doing this, minimum distance , maximum distance:
for( int = 0; < descriptors1.rows; i++ ) { double dist = matches[i].distance; if( dist < min_dist ) min_dist = dist; if( dist > max_dist ) max_dist = dist; }
if above approach correct, how can use minimum distance , maximum distance check whether images matching.
thanks.
i grateful, if can sought out me. thanks.
you can try match images knnmatch()
method, calculating 2 nearest neighbors. each descriptor in first image have 2 closest matches in second image.
these matches 2 best ones based on distance between descriptors. if distances of these matches similar, possible select wrong one. in case, should discard matches. can checking distance ratio. if ratio of distances between first match , second match not greater chosen threshold should discard matches. afterwards can example ransac test better results.
Comments
Post a Comment