Ask Your Question

openCVManager on android

asked 2013-09-26 03:07:39 -0500

nakano gravatar image


I have a question concerning openCVManager.

So far when I launch a sample or launch my own project, I always have to download the application "openCVManager".

Due to the project manager in my company, my application must not need to download another application for working :S

As a result I would like to know if it is possible to launch openCV without having to download the openCVManager application?

I really thank you in advance for your help

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-09-26 03:19:01 -0500

Moster gravatar image

Use the static initialization. This will include the opencv libs into the android apk which will of course increase the general app size

edit flag offensive delete link more



Thank you for your message :) It looks like I'm looking for static initialization but after doing the 4 steps, when I launch my application I'm still asking to download the openCVManager (I'm using openCV SDK 2.4.5). What I've done so far is:

1- import openCV Library - 2.4.5

2- In my project, I've added the openCV Library <my project>/properties/Android and add the library

3- as My project doesn't have jni part, I've copied all folder from <openCV Library 2.4.5>/sdk/native/libs to <my project>/libs

4- In my activity, I've added static { OpenCVLoader.initDebug() }

Am I missing something? Could you please tell me what I've done wrong/forget?

nakano gravatar imagenakano ( 2013-09-26 03:40:02 -0500 )edit

Maybe you didnt remove the BaseLoaderCallBack and OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, this, mLoaderCallback) from your code?

Moster gravatar imageMoster ( 2013-09-26 03:47:24 -0500 )edit

Thank you, I've forgotten to remove these 2 parts^^' .

However when I launch my application I have a full black screen. As I don't have any jni part, I suppose I don't have to create a jni folder and add the file?

In my logcat, I only have 3 lines :

CameraBridge(3810): Attr count: 6

CameraBridge(3810): Attr count: 6

CameraBridge(3810): call surfaceChanged event

Could you please tell me what's wrong?

nakano gravatar imagenakano ( 2013-09-26 03:55:38 -0500 )edit

after relaunching the application, I received more information in the logcat. Below are the trouble :

dalvikvm(3983): Could not find class '', referenced from method

VFY: unable to resolve new-instance 60 (Landroid/graphics/SurfaceTexture;) in Lorg/opencv/android/JavaCameraView;

VFY: replacing opcode 0x22 at 0x0282

VFY: dead code 0x0284-0297 in Lorg/opencv/android/JavaCameraView;.initializeCamera (II)Z

nakano gravatar imagenakano ( 2013-09-26 04:04:00 -0500 )edit

I've checked another post for the same trouble ( and I figured out what was wrong :). I just had to replace OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_5, this, mLoaderCallback) by mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);

Now everything works fine :) thank you for your help ^-^

nakano gravatar imagenakano ( 2013-09-26 05:02:50 -0500 )edit

Your solution just works, because you most likely call mOpenCameraView.enableView() in onManagerConnected().

Moster gravatar imageMoster ( 2013-09-26 05:27:53 -0500 )edit

answered 2013-09-26 05:06:29 -0500

Moster gravatar image

Ok, I checked out the static initialization and everything worked fine regarding that, but somehow the functions of the CameraViewListener never got called. So I simply activated the cameraview in the OnResume() function. (mOpenCvCameraView in my case)

public void onResume(){
edit flag offensive delete link more

Question Tools


Asked: 2013-09-26 03:07:39 -0500

Seen: 844 times

Last updated: Sep 26 '13