Git Product home page Git Product logo

opencv_native_androidstudio's People

Contributors

leadrien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencv_native_androidstudio's Issues

could not load library "libopencv_java3.so"

Hi! I'm testing your app with several devices it works perfectly fine with my Moto G 1st gen Android 5.0, but it doesn't in a Samsung Galaxy Grand Neo (API level 17) I've change minimum SDK from Gradle in order to load it on this device.

The problem I'm facing is that it work won't on this device, error is:

E/dalvikvm: dlopen("/data/app-lib/com.packagename/libnative-lib.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libopencv_java3.so" needed by "libnative-lib.so"; caused by load_library(linker.cpp:746): library "libopencv_java3.so" not found

followed by:

E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1636): could not load library "libopencv_java3.so" needed by "libnative-lib.so"; caused by load_library(linker.cpp:746): library "libopencv_java3.so" not found
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:535)
at com.packagename.MainActivity.onCreate(MainActivity.java:45)
at android.app.Activity.performCreate(Activity.java:5326)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2218)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309)
at android.app.ActivityThread.access$700(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5319)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)

jniLIbs symlink is correct and I also tried coping the CPU folders inside a jniLibs folder just to test if the symlink was the problem and still getting the same error.

I downloaded "What's my ABI?" from playstore and both Moto G and Samsung Galaxy Grand Neo are armeabi-v7a

any ideas? Thank you

Cannot find 'opencv2'

Hi, thank you for your work.
I have followed all your steps to create a project from scratch.
It all works fine, but in native-lib.cpp I have this problem
Error:(3, 10) fatal error: 'opencv2/core.hpp' file not found
I said that all works fine because I tried to change
#include <opencv2/core.hpp>
in
#include <[my custom path]/opencv2/core.hpp>
where my custom path is a folder that contain the opencv directories that usually are in /local/include and it works.

Obv this is not a solution, because I have to modify also all the opencv library header.
I tried to copy opencv2 and opencv in the same folder of native-code.cpp, same problem.
Can you help me?

Compilation failed

Hello, I am not very familiar with ndk, and I got an error in compiling the project. Is this asking me to compile the so file by cmake? I remember that I don’t need to compile it manually in android studio

Error message:
Build command failed.
Error while executing process D:\androidsdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\Administrator\Desktop\zuoz\imageview\opencv_native_androidstudio-master\app.cxx\cmake\debug\arm64-v8a --target native-lib}

ninja: error: '../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

Messages Gradle Build Error

i got this gradle error after importing this project,

Gradle tasks [:app:assembleDebug]
error: '../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it
BUILD FAILED
..

what doesn't mean ?

The software does not work as delivery

Hello,
When I try to run the Android App, I have this message :
Build command failed.
Error while executing process C:\Users\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\Desktop\opencv_native_androidstudio-master\opencv_native_androidstudio-master\app.externalNativeBuild\cmake\debug\x86 --target native-lib}
ninja: error: '../../../../src/main/jniLibs/x86/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/x86/libnative-lib.so', missing and no known rule to make it

Could you help ?
Thank you,
Christophe

Rotated camera Image

Hello! Thanks for sharing this and making the Usage guide. I've manage to compile and test your code, but the only problem I'm facing is that screen image is rotated 90° (non clockwise). Any idea of what's going on?

Thanks in advance!

PS: I'm using a Moto G 1st gen

build errors

Hi,
I want to work on OpenCV with native C++ and trying to build your project.
i have encountered a cmake build problem.
I think its a simple problem but i still couldn't figure out, maybe you might have an idea.

What went wrong:
Execution failed for task ':app:externalNativeBuildDebug'.

Build command failed.
Error while executing process C:\Users\sakthivel\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build D:\OCVA\opencv_native_androidstudio-master\opencv_native_androidstudio-master\app.externalNativeBuild\cmake\debug\arm64-v8a --target native-lib}
ninja: error: '../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

armeabi-v7a is not support exceptions

I added a simple exception in native-lib.cpp and the app crashed.

extern "C"
{
void JNICALL Java_ch_hepia_iti_opencvnativeandroidstudio_MainActivity_salt(JNIEnv *env, jobject instance,
                                                                           jlong matAddrGray,
                                                                           jint nbrElem) {
    try {
        throw logic_error("");
    }
    catch (logic_error) {
    }

    Mat &mGr = *(Mat *) matAddrGray;
    for (int k = 0; k < nbrElem; k++) {
        int i = rand() % mGr.cols;
        int j = rand() % mGr.rows;
        mGr.at<uchar>(j, i) = 255;
    }
}
}

And the program work perfect without lib_opencv.

target_link_libraries( # Specifies the target library.
                       native-lib

                       # OpenCV lib
                       # lib_opencv

                       # Links the target library to the log library
                       # included in the NDK.
                       ${log-lib} )

I am getting NDK not configured error

NDK not configured.
Download it with SDK manager.

Update NDK version to 21.3.6528147 and sync project

I have already installed NDK even though I am getting this error.

Can you please help to resolve this issue.

Just want to say thanks.

Of all guide on creating OpenCv with c++ on Android Studio, this is the only one that I managed to get it work.

Thanks. Much appreciated.

Nice Repositori

sir i have read your repository and it so clean to read, but i get some problem that i got not reference by class cvtColor on .cpp file how should i do that? thank you

libnative-lib.so', missing and no known rule to make it

Error:error: '../../../../src/main/jniLibs/arm64-v8a/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/arm64-v8a/libnative-lib.so', missing and no known rule to make it

Hello @leadrien ,
I compile this project failed, do you have any clue?

Changing the name / slogan of repo to make it easier to be searched by google

Hello! I think this repo is really helpful, and it works well for me! However, it takes a lot of time before I find this repo using google. Even using "opencv native android studio" I cannot find this repo... Therefore, I suggest changing the repo name or slogan, such that more people can find and use it :)

OpenCV 4.0 support

Hi! Thanks for this wonderful project! Now OpenCV4 has released, so how should I update it to V4? I am willing to give a PR!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.