Android OpenCV 3.1.0 - Android OpenCV Manager
Android OpenCV 3.1.0 - Android OpenCV Manager¶
Test Android OpenCV Manager¶
Run Eclipse,create a new project.
If target is Android 6.0,and then input project name.
Once you confirm ok, click the button 'Next >'.
Once you confirm ok, click the button 'Next >'.
Once you confirm ok, click the button 'Next >'.
Once you confirm ok, click the button 'Finish'.
Choice 'Import…',we will include 'OpenCV 3.1.0 SDK'.
We will run 'existing Android Code Into Workspace'.
Click the button 'Browse'.
You need to find out the folder 'OpenCV-3.1.0-android-sdk', sub directory is 'sdk'.
Including OpenCV 3.1.0.
In the project 'OpenCVTest', click the right key of mouse, appear a menu, click the item 'Properties'.
Click the button 'Add'.
Add 'OpenCV Library – 3.1.0'
Double click the file 'MainActivity.java'
protected static final String TAG = "OpenCVTest"; @Override public void onResume() { super.onResume(); OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_1_0, this, mLoaderCallback); } private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) { @Override public void onManagerConnected(int status) { switch (status) { case LoaderCallbackInterface.SUCCESS: { Log.i(TAG, "OpenCV loaded successfully"); } break; default: { super.onManagerConnected(status); } break; } } };
Move the mouse cursor on the red wave line, appear quick fix items.
Click the item 'Import ...', Step by step until no red wave line.
Click the button 'Run',and then choice the item 'Run Configurations…'.
Choice the AVD of Android 6.0.
Appear run-time screen.
In the Logcat, you will see the green words 'OpenCV loaded successfully'.
We are finish this test Android OpenCV Manager 3.1.0.