3

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

2
  • 1
    Have you any output messages in STDERR? Commented Apr 7, 2013 at 13:15
  • 1
    I tried to display error in logcat. I got same fatal signal error. On the other hand i don't know how to use or where to use STDERR. Commented Apr 7, 2013 at 14:09

3 Answers 3

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I am open to any useful criticism about this topic. If i am wrong please correct me.
I have followed tutorial of ORB features given in link you have provided, but problem with me is it is always giving no. of good matches same(equal to 500), i have tried it with different images, then min and max values changes but no of good matches are remained same. also i want to get coordinates of scene in object image, if you know how to do this please help me out
3

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.

2 Comments

I have referred that tutorial, i have created 2 .so files as they have described. Now i want to use surf detection, but how should i write the code(c++ or java) and then how to call that method from my android code. Please guide me in doing that, thanks for support
The 2nd part of the tutorial shows how to use the OpenCV functions through NDK and JNI: sites.google.com/site/wghsite/technical-notes/…
0

Download older version, i.e. 4.2.1 or 4.2.0 of opencv and use it into your project

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.