Using nonfree (SIFT, SURF) in android with java

I'm having problems with proprietary using methdos in android. SIFT and SURF methods are not included in opencv-android-2.4.8. They must be carried out separately.

https://sites.google.com/site/wghsite/technical-notes/sift_surf_opencv_android

This is a basic compilation tutorial without crashes. However, the jni part is not enabled for java users. I was looking for how to use compiled .so libraries, but I could not achieve.

Interestingly, someone can share a part of jni for non-free modules or a detailed explanation of this, because I have been working on this issue for a week and I could not do this.

Thanks.

+4
source share
4 answers

I am the author of the textbook. I will add another tutorial showing part of the JNI. Hope this helps. Go back and check out the tutorial in the next couple of days. I will send it soon.

+2
source

I solved the problem. When you follow the manual (the link asked in the question), you get the necessary libraries (.so files). To use them in java, you do not need to implement the jni part. When you load libraries into your Java code (System.load (libraryName)), you can use sift and surf methods, such as other detectors or descriptors. You can directly use the code template provided by opencv-2.4.8.

+1
source

, OpenCV 4 Android Android;

1) libnonfree.so, libopencv_java.so libgnustl_shared.so( , ) , jniLibs/armeabi-v7a. -; https://github.com/bkornel/opencv_android_nonfree

2) .

static {
    System.loadLibrary("opencv_java");
    System.loadLibrary("nonfree");
}

, , .

+1

@fetifati, , libnonfree.so libopencv_java.so lib/armeabi System.load( "nonfree" ); System.load( "opencv_java" ), :

private static final FeatureDetector detector = FeatureDetector
        .create(FeatureDetector.SIFT);
private static final DescriptorExtractor extractor = DescriptorExtractor
        .create(DescriptorExtractor.SIFT);

?... , . .

0

Source: https://habr.com/ru/post/1528001/


All Articles