I am using the ORB feature detector to find matches between two images using this code:
FeatureDetector detector = FeatureDetector.create(FeatureDetector
After reading Rober Langaniere book. I came to know there is a way. It is to remove matches with the further distances. In java, it is as following
Collections.sort(bestMatches,new Comparator() {
@Override
public int compare(DMatch o1, DMatch o2) {
if(o1.distanceo2.distance)
return 1;
return 0;
}
});
if(bestMatches.size()>3){
bestMatches = bestMatches.subList(0,3);
}