Tuesday 22 September 2020

How can we fork opencv-android repo and use it in own project?

I had used openCV for android from this repo https://github.com/quickbirdstudios/opencv-android. its worked and also camera was running. But there is a issue with camera orientation in this repo. So I just forked and published mine using https://jitpack.io/ without any changes (just to check if its working).

build.gradle:

dependencies {
  implementation 'com.quickbirdstudios:opencv:3.4.1' 
}

After published with jitpack and changed my dependencies:

dependencies {
    implementation 'com.github.Balasnest:opencv-android:0.1.1' // gradle build success here
}

But problem is getting error saying OpenCV error: Cannot load info library for OpenCV when below code is executed.

public class MainActivity extends Activity {
    static {
        if (!OpenCVLoader.initDebug()) // Failed to load OpenCV
            Log.d("ERROR", "Unable to load OpenCV");
        else
            Log.d("SUCCESS", "OpenCV loaded");
    }
...
}

Error Logs:

D/OpenCV/StaticHelper: Trying to get library list
09-17 00:15:04.423 14150-14150/com.app E/OpenCV/StaticHelper: OpenCV error: Cannot load info library for OpenCV
09-17 00:15:04.423 14150-14150/com.app D/OpenCV/StaticHelper: Library list: ""
09-17 00:15:04.423 14150-14150/com.app D/OpenCV/StaticHelper: First attempt to load libs
09-17 00:15:04.423 14150-14150/com.app D/OpenCV/StaticHelper: Trying to init OpenCV libs
09-17 00:15:04.423 14150-14150/com.app D/OpenCV/StaticHelper: Trying to load library opencv_java3
09-17 00:15:04.424 14150-14150/com.app D/OpenCV/StaticHelper: Cannot load library "opencv_java3"
09-17 00:15:04.424 14150-14150/com.app W/System.err: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.app-1/base.apk"],nativeLibraryDirectories=[/data/app/com.app-1/lib/arm, /data/app/com.app-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libopencv_java3.so"
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at java.lang.Runtime.loadLibrary(Runtime.java:367)
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at java.lang.System.loadLibrary(System.java:1076)
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at org.opencv.android.StaticHelper.loadLibrary(StaticHelper.java:67)
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at org.opencv.android.StaticHelper.initOpenCVLibs(StaticHelper.java:98)
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at org.opencv.android.StaticHelper.initOpenCV(StaticHelper.java:42)
09-17 00:15:04.439 14150-14150/com.app W/System.err:     at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:107)

Let me know how can we fork opencv-android lib, modify and use it in our project? Why OpenCV lib not loaded from my forked repo?



from How can we fork opencv-android repo and use it in own project?

No comments:

Post a Comment