Nearest Neighbors Ratio in Java

asked 2013-12-18 04:27:51 -0600

DonCossack gravatar image

Hi.

I am doing the feature matching with OpenCV in Java and it gets stuck into one point. After performing the detection, descriptor computation and matching, the result is a List<matofdmatch> and I am not quite sure how to handle this to remove "bad matches".

List<MatOfDMatch> listofmatches=new ArrayList<MatOfDMatch>();

    int k=2;

    BruteForce.knnMatch(descriptor1, descriptor2, listofmatches,k);

descriptor1 is Mat, which belongs to querry image and descriptor2 is train image.

How should I handle the listofmatches to remove bad matches? It is a little different as in C++.

Thank you very much

edit retag flag offensive close merge delete