OpenCV filtering ORB matches

后端 未结 3 1544
醉梦人生
醉梦人生 2020-12-09 00:10

I am using the ORB feature detector to find matches between two images using this code:

    FeatureDetector detector = FeatureDetector.create(FeatureDetector         


        
3条回答
  •  一生所求
    2020-12-09 00:28

    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);
        }
    

提交回复
热议问题