FLANN match

asked 2013-02-11 03:06:32 -0600

muthu gravatar image

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...

            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??

edit retag flag offensive close merge delete


Did you follow the tutorials/samples on matching? And what error do you get?

sammy gravatar imagesammy ( 2013-02-11 04:06:41 -0600 )edit

ya of course i followed...I dint get any syntactical error..there's no prob until descriptor extraction..just when i include the code foe matching the app is force closed(eclipse emulator)...

muthu gravatar imagemuthu ( 2013-02-11 07:59:32 -0600 )edit