DescriptorMatcher in OpenCV3 for Android

asked 2017-01-24 02:48:55 -0600

zhongen.dff gravatar image

Dear all, I am a newbie for developing with OpenCV and computer Vision, this is a first project i developed with OPENCV on Mobile - Android - used Android Studio.

I can use many functions of OpenCV Library, but when I call DescriptoerMatcher in Java file, I miss errors, details code:

//detect the key points detector.detect(inputMat1,keypoints1); detector.detect(inputMat2,keypoints2);

//detect decriptor Mat descriptors1 = new Mat(); Mat descriptors2 = new Mat(); descriptorExtractor.compute(inputMat1,keypoints1,descriptors1); descriptorExtractor.compute(inputMat2,keypoints2,descriptors2);

processedMat1 = new Mat(); processedMat2 = new Mat();

Imgproc.cvtColor(inputMat1,processedMat1,Imgproc.COLOR_RGBA2RGB); Imgproc.cvtColor(inputMat2,processedMat2, Imgproc.COLOR_RGBA2RGB);

Features2d.drawKeypoints(processedMat1,keypoints1,processedMat1,new Scalar(255,255,0),4); Features2d.drawKeypoints(processedMat2,keypoints2,processedMat2,new Scalar(255,255,0),4);

DescriptorMatcher descriptorMatcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);

But the error is line create DescriptoerMatcher.

Detailed of error: JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0x4 from long org.opencv.features2d.DescriptorMatcher.create_0(int)

I trying research but now, I haven't found a issue and how to implement error.

Hope received of any people. Thanks so much.

edit retag flag offensive close merge delete


hmm, you're already the 2nd person reporting this.

maybe it's time to raise an issue ?

berak gravatar imageberak ( 2017-01-24 03:49:28 -0600 )edit

thanks berak,

beside DescriptorMatcher, I can't use. You can suggest to me new solution instead of it. Because i take a solution with compare object in android. Thanks so much.

zhongen.dff gravatar imagezhongen.dff ( 2017-01-24 04:20:33 -0600 )edit