Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the .match(..) method returns MatOfDMatch object with zero ditances?!

in the below code, i am trying to display the values of the distances included in the matDMatch object, but as you see at the commented out for-loop, the distnces stored in the matDMatch object are zeros.

why the distnces are zeros and what does it mean?

Code:

MatOfDMatch matDMatch = new MatOfDMatch();
    DescriptorMatcher descripMatcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
    descripMatcher.match(mat_jf01_QueryDescriptor, mat_jf01_revQueryDescriptor, matDMatch);

    Highgui.imwrite(path_jf01_Matches, matDMatch);
    System.out.println("matDMatch.size: " + matDMatch.size());
    System.out.println("matDMatch.width: " + matDMatch.size().width);
    System.out.println("matDMatch.height: " + matDMatch.size().height);

    /*Draw Matches*/
    Mat mat_jf01_DrawnMatches = new Mat();
    Features2d.drawMatches(path2Mat(path_jf01), matKeyPts_jf01, path2Mat(path_jf01_rev), matKeyPts_jf01_rev, matDMatch, mat_jf01_DrawnMatches);
    Highgui.imwrite(path_jf01_DrawnMatches, mat_jf01_DrawnMatches);

    List<DMatch> dMatchList = matDMatch.toList();
    DMatch[] dMatArray = matDMatch.toArray();
    System.out.println("dMatchArray.length(): " + dMatArray.length);
    System.out.println("dMatchList.size(): " + dMatchList.size());

    /*for (int i = 0; i < dMatchList.size(); i++) {
        System.out.println("dMatchList.get(" + i + "): " + dMatchList.get(i).distance);// this line shows that the distnces are zeros, why?
    }*/
    float[] minMaxDist = thresolding(10, 100,dMatchList);
    goodMatches(minMaxDist, dMatchList);
}
click to hide/show revision 2
retagged

updated 2015-03-30 08:09:41 -0500

berak gravatar image

the .match(..) method returns MatOfDMatch object with zero ditances?!

in the below code, i am trying to display the values of the distances included in the matDMatch object, but as you see at the commented out for-loop, the distnces stored in the matDMatch object are zeros.

why the distnces are zeros and what does it mean?

Code:

MatOfDMatch matDMatch = new MatOfDMatch();
    DescriptorMatcher descripMatcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
    descripMatcher.match(mat_jf01_QueryDescriptor, mat_jf01_revQueryDescriptor, matDMatch);

    Highgui.imwrite(path_jf01_Matches, matDMatch);
    System.out.println("matDMatch.size: " + matDMatch.size());
    System.out.println("matDMatch.width: " + matDMatch.size().width);
    System.out.println("matDMatch.height: " + matDMatch.size().height);

    /*Draw Matches*/
    Mat mat_jf01_DrawnMatches = new Mat();
    Features2d.drawMatches(path2Mat(path_jf01), matKeyPts_jf01, path2Mat(path_jf01_rev), matKeyPts_jf01_rev, matDMatch, mat_jf01_DrawnMatches);
    Highgui.imwrite(path_jf01_DrawnMatches, mat_jf01_DrawnMatches);

    List<DMatch> dMatchList = matDMatch.toList();
    DMatch[] dMatArray = matDMatch.toArray();
    System.out.println("dMatchArray.length(): " + dMatArray.length);
    System.out.println("dMatchList.size(): " + dMatchList.size());

    /*for (int i = 0; i < dMatchList.size(); i++) {
        System.out.println("dMatchList.get(" + i + "): " + dMatchList.get(i).distance);// this line shows that the distnces are zeros, why?
    }*/
    float[] minMaxDist = thresolding(10, 100,dMatchList);
    goodMatches(minMaxDist, dMatchList);
}

the .match(..) method returns MatOfDMatch object with zero ditances?!

in the below code, i am trying to display the values of the distances included in the matDMatch object, but as you see at the commented out for-loop, the distnces stored in the matDMatch object are zeros.

why the distnces are zeros and what does it mean?

Code:

MatOfDMatch matDMatch = new MatOfDMatch();
    DescriptorMatcher descripMatcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
    descripMatcher.match(mat_jf01_QueryDescriptor, mat_jf01_revQueryDescriptor, matDMatch);

    Highgui.imwrite(path_jf01_Matches, matDMatch);
    System.out.println("matDMatch.size: " + matDMatch.size());
    System.out.println("matDMatch.width: " + matDMatch.size().width);
    System.out.println("matDMatch.height: " + matDMatch.size().height);

    /*Draw Matches*/
    Mat mat_jf01_DrawnMatches = new Mat();
    Features2d.drawMatches(path2Mat(path_jf01), matKeyPts_jf01, path2Mat(path_jf01_rev), matKeyPts_jf01_rev, matDMatch, mat_jf01_DrawnMatches);
    Highgui.imwrite(path_jf01_DrawnMatches, mat_jf01_DrawnMatches);

    List<DMatch> dMatchList = matDMatch.toList();
    DMatch[] dMatArray = matDMatch.toArray();
    System.out.println("dMatchArray.length(): " + dMatArray.length);
    System.out.println("dMatchList.size(): " + dMatchList.size());

    /*for (int i = 0; i < dMatchList.size(); i++) {
        System.out.println("dMatchList.get(" + i + "): " + dMatchList.get(i).distance);// this line shows that the distnces are zeros, why?
    }*/
    float[] minMaxDist = thresolding(10, 100,dMatchList);
    goodMatches(minMaxDist, dMatchList);
}