Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SURF Feature Extraction With Android OpenCV SDK - Getting Some Errors

I am trying to implement SURF features in my project which is about face recognition. I am new at opencv on android. So it is a little bit hard to find logical errors. Also i tried to search from google but nothing i could fix. I imported the libray org.opencv.features2d for handling feature issues.

At the beginning this is my SURF implementation code(a part of).

    public void SURFExtraction()
{
    FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
    DescriptorExtractor SurfExtractor = DescriptorExtractor.create(DescriptorExtractor.SURF);

     Mat img1 = Highgui.imread("/mnt/sdcard/FaceDB/1.jpg");//one of my face
     Mat img2 = Highgui.imread("/mnt/sdcard/FaceDB/2.jpg");//one of my different face

    //extract keypoints
    MatOfKeyPoint keypoints = new MatOfKeyPoint();
    MatOfKeyPoint logoKeypoints = new MatOfKeyPoint();

     detector.detect(img1, keypoints);//this is the problem "fatal signal"
     Log.d("LOG!", "number of query Keypoints= " + keypoints.size());
     detector.detect(img2, logoKeypoints);
     Log.d("LOG!", "number of logo Keypoints= " + logoKeypoints.size());


}

When i execute the program it gives a single error. Just this.

  A/libc(30444): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

I searched for this error. They said that this error occurs when native classes try to reach or write 0x00000000 memory address. But i couldn't figure out how to fix this issue. Can you tell me what can i do?

Thanks in advance

like image 470
COvayurt Avatar asked Jan 17 '26 18:01

COvayurt


2 Answers

Ok! SURF features now patented according to this thread. So i think the error about this issue. Who ever trying to extract SURF feature, you can continue with ORB features which at this thread works fine unless matching features. I hope this will help searching for android SURF features extraction.

like image 77
2 revsCOvayurt Avatar answered Jan 20 '26 08:01

2 revsCOvayurt


SURF is not include in the distribution package of OpenCV Android. To use it, you need to compile the nonfree module and use it in your project. So, what you need to do is to create a NDK project, compile the nonfree module as a standalone library. Then use this library to compile your program. Then you should be able to build your application. You can refer to this tutorial.

like image 43
Robert Wang Avatar answered Jan 20 '26 08:01

Robert Wang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!