Ask Your Question
0

openCVManager on android

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

nakano gravatar image

Hello,

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
1

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

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

http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html

edit flag offensive delete link more

Comments

Hello,

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 -0600 )edit
1

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 -0600 )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 Android.mk 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 -0600 )edit

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

dalvikvm(3983): Could not find class 'android.graphics.SurfaceTexture', referenced from method org.opencv.android.JavaCameraView.initializeCamera

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 -0600 )edit

I've checked another post for the same trouble (http://answers.opencv.org/question/2562/static-initialization-of-opencv-on-android/) 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 -0600 )edit

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

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

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

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(){
    super.onResume();
    mOpenCvCameraView.enableView();
}
edit flag offensive delete link more

Question Tools

Stats

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

Seen: 994 times

Last updated: Sep 26 '13