Hey guys,
Ive got a problem with the crosscheck feature in the BFMatcher. Im trying to use this on android, but somehow the matcher seems to do crap. It produces lots of good results, but sometimes it returns queryIdx' and trainIdx' that are far away from the number of Matches. Basically I declare the matcher to use crosscheck and I also use knnMatch with k=1. After they got matched, I log the indices. Lots of them are correct, but not all.
BFMatcher matcher(NORM_HAMMING,true);
matcher.knnMatch(queryDescriptors, trainDescriptors, matches, 1);
for (unsigned int i=0; i<matches.size(); i++){
LOGE("query Idx:%d, trainIdx:%d", matches[i][0].queryIdx, matches[i][0].trainIdx);
/* circle(*frame,queryPoints[matches[i][0].queryIdx].pt, 1, Scalar(255,255,0,255));
line(*frame,queryPoints[matches[i][0].queryIdx].pt, trainPoints[matches[i][0].trainIdx].pt, Scalar(255,255,255,255));
circle(*frame,trainPoints[matches[i][0].trainIdx].pt, 1, Scalar(255,0,0,255));*/
}