List KeyPoint missing queryIdx

asked 2018-09-25 13:04:10 -0500

hayley gravatar image

updated 2018-09-26 09:12:59 -0500

I am doing some feature matching and I am seeing that some KeyPoints in the list don't have the queryIdx listed, only the trainIdx. Is there an explanation for that?

Also, I'm not sure if they are related but I noticed that the number of keypoints for my reference image does not match the number of keypoints detected from my test image.

Here is a snippet of my code:

    private MSER mFeatureDetector = MSER.create();
    mFeatureDetector.detect(ReferenceImage, ReferenceKeypoints);
    mDescriptorExtractor.compute(ReferenceImage, ReferenceKeypoints, ReferenceDescriptors);

    private final DescriptorExtractor mDescriptorExtractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
    mFeatureDetector.detect(TestImage, TestKeypoints);
    mDescriptorExtractor.compute(TestImage, TestKeypoints, TestDescriptors);

    private final DescriptorMatcher DescriptorMatcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMINGLUT);
    DescriptorMatcher.match(ReferenceDescriptors,TestDescriptors, Matches);

    final List<DMatch> matchesList = Matches.toList();
    final List<KeyPoint> referenceKeypointsList = ReferenceKeypoints.toList();
    final List<KeyPoint> sceneKeypointsList = TestKeypoints.toList();
    final ArrayList<Point> goodReferencePointsList = new ArrayList<Point>();
    final ArrayList<Point> goodScenePointsList = new ArrayList<Point>();

    for (final DMatch match : matchesList) {

In the for-loop, I see there are often sceneKeypointsList.get(match.trainIdx).pt) but the sceneKeypointsList.get(match.queryIdx).pt) is blank.

edit retag flag offensive close merge delete


well, the error is likely in your code, so please append it to your question !

berak gravatar imageberak ( 2018-09-25 13:30:28 -0500 )edit

Hi @berak, I just updated my question. Thanks.

hayley gravatar imagehayley ( 2018-09-26 05:32:16 -0500 )edit