0

I'm develloping an application for Android using Android Studio. I already built the camera part of my application with Camera2 API, now i want to process the images using JavaCV (To get the frames i was going on and ImageReader, but it give me YUV_420_888 frames that i can't even save in a good shape).

So i followed the manualy install tutorial of JavaCV for AndroidStudio here : https://github.com/bytedeco/javacv

When i write some code, the library are found. But when i execute this :

        opencv_highgui.CvCapture capture = opencv_highgui.cvCreateCameraCapture(opencv_highgui.CV_CAP_ANDROID);

I got this (warning, lot of crap down there):

07-01 18:00:41.649    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r2.2.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r2.2.0.so"...
07-01 18:00:41.653    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r2.3.3.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r2.3.3.so"...
07-01 18:00:41.658    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r3.0.1.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r3.0.1.so"...
07-01 18:00:41.663    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.0.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.0.0.so"...
07-01 18:00:41.668    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.0.3.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.0.3.so"...
07-01 18:00:41.673    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.1.1.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.1.1.so"...
07-01 18:00:41.678    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.2.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android6Camera10disconnectEv" referenced by "libnative_camera_r4.2.0.so"...
07-01 18:00:41.684    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.3.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1EbRKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "libnative_camera_r4.3.0.so"...
07-01 18:00:41.689    9655-9655/ca.uqtr.camera2videobasic E/art﹕ dlopen("/data/app/ca.uqtr.camera2videobasic-2/lib/arm/libnative_camera_r4.4.0.so", RTLD_LAZY) failed: dlopen failed: cannot locate symbol "_ZN7android11BufferQueueC1ERKNS_2spINS_19IGraphicBufferAllocEEE" referenced by "libnative_camera_r4.4.0.so"...

And finally :

CameraWrapperConnector::connectToLib ERROR: cannot dlopen camera wrapper library Native_camera returned opening error: 4

So, what my libs looks like ?

enter image description here

I didn't touched to Gradle. To use those jar i added them with : Project Structure > app > dependecies > add files dependencies

I tried a lot of install version that flow on internet and finally i decided to return on good bases with the official tutorial.

Like this, i can ask you what is the good way to install JavaCV ? I mean can it finally found those missed libs ? I passed so much time on this that i'm not still very sure... Ps : Sry for my bad english and i'm open to all your questions.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Widea
  • 129
  • 2
  • 14

1 Answers1

0

You can fully install JavaCV using gradle. Please take a look at this answer and you should be able to correctly install it.

https://stackoverflow.com/a/30130559/3990222

Just as an example, try adding the following lines to your gradle file and removing your .jar files:

compile group: 'org.bytedeco', name: 'javacv', version: '0.11'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-arm'
Community
  • 1
  • 1
Edson Menegatti
  • 4,006
  • 2
  • 25
  • 40