Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

FLANN match

I'm trying to match an input image with image in the file("coke.jpg") in android.. The code works before matching step.(up to extracting descriptors)..Im even able to see the keypoints in drawn..But matching stops the program...

            inputFrame.copyTo(mRgba);
            File root = Environment.getExternalStorageDirectory();
            File file = new File(root, "coke.jpg");
            m1 = Highgui.imread(file.getAbsolutePath());    

            Imgproc.cvtColor(m1, m3, Imgproc.COLOR_BGRA2GRAY);

            Imgproc.cvtColor(mRgba, mIntermediateMat, Imgproc.COLOR_BGRA2GRAY, 4);

           FeatureDetector detector = FeatureDetector.create(FeatureDetector.ORB);

           detector.detect(mIntermediateMat, keypoints);
           detector.detect(m3, keypoints1);

           DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
           extractor.compute(mIntermediateMat, keypoints, features);
           extractor.compute(m3, keypoints1, features1);

           MatOfDMatch matches1=new MatOfDMatch();

           DescriptorMatcher flannmatcher1=DescriptorMatcher.create(DescriptorMatcher.FLANNBASED);

          **flannmatcher1.match(features, features1, matches1);**

Please help me over this..Do i need to initialize MatOfDMatch in a different way??