Does the matching work in OpenCV 2.4.4?
The Reason I ask this question is the following: when I match both my descriptors that are of the size 64x241 and 64x258 with
matcher.match(descriptorsa,descriptorsb,matches);
the matches contain 1x258 matches... how is this possible when the descriptors in the first image only contain 241 descriptors?
EDIT:
These are the matches after I did the matcher.match(descriptorsa,descriptorsb,matches);
function.
Matches on the original picture
Here i get 258 matches with the original image, while the image has nothing to do with the original one, after being filtered (see first) and The image that is almost identical to the original, which has gives 61 matches after being filtered.
The code is the following:
//matcher
MatOfDMatch matches = new MatOfDMatch();
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
matcher.match(descriptorsDB,descriptorsCamera,matches);
Log.d("LOG!", "Aantal goeie matches na de .match= " + matches.size());
MatOfDMatch goedematches = new MatOfDMatch();
double max_dist = 0;
double min_dist = 100000;
if (descriptorsDB.cols() == descriptorsCamera.cols())
{
// calculates max and min distance between keypoints
for( int i = 0; i < descriptorsDB.rows(); i++ )
{ double dist = matches.toArray()[i].distance;
if( dist < min_dist ) min_dist = dist;
if( dist > max_dist ) max_dist = dist;
}
// tekent enkel goeie matches
for( int i = 0; i < descriptorsDB.rows(); i++ )
{ MatOfDMatch temp = new MatOfDMatch();
if( matches.toArray()[i].distance <= 2*min_dist )
{ temp.fromArray(matches.toArray()[i]);
goedematches.push_back(temp);
}
}