unsatistiedlinkederror n_mat

OpenCV Manager, like other Android API, uses asynchronous event handling model. So, OpenCV library is not ready for use before onManagerConnected event with LoaderCallbackInterface.SUCCESS status.
You cannot use any OpenCV related staff, even OpenCV dependent object constructors before initialization. First of all you need to move your camera initialization code to OnManagerConnected method. Then you need to move View initialization here, due to View depends on OpenCV too. You must get something like this:

private BaseLoaderCallback  mOpenCVCallBack = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i("Load OpenCV", "OpenCV loaded successfully");
setContentView(R.layout.main);
amSurfaceView=(SurfaceView)findViewById(R.id.CamSurfaceView);
setupCamera();
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};

OnManagerConnected callback will be called in UI thread, when initialization finishes. Please note, that it is not allowed to use OpenCV calls or load OpenCV-dependent native libs before invoking this callback. Load your own native libraries after OpenCV initialization.

Using async initialization is a preferred way for application development. It uses OpenCV Manager Android service to get OpenCV libraries.

  1. Add OpenCV library project to your workspace.
  2. In application project add reference to OpenCV Java SDK

Add dependency from OpenCV library

Add dependency from OpenCV library

If you want to use OpenCV Manager-based approach you need to install packages with the Service and OpenCV package for you platform. You can do it using Google Play service or manually with adb tool:

1
2
adb install ./org.opencv.engine.apk
adb install ./org.opencv.lib_v24_<hardware version>.apk

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: