Go to Opencvmanager, most for reprint, only when you learn to use

Source: Internet
Author: User

Go to Opencvmanager method, can refer to this blog http://blog.csdn.net/yanzi1225627/article/details/27863615, can use, very good. I'm just doing a summary here, mark for myself.
In addition, refer to these two blog posts, can realize http://m.blog.csdn.net/blog/formcc_tjsd/25707775,http://m.blog.csdn.net/blog/wunghao8/38870047

First you have to import the OpenCV SDK
1. Import the OpenCV Library project file into your project directory.
I use this: OpenCV SDK path (OPENCV-2.4.8.2-TEGRA-SDK/SDK)
2. Refer to the Opencv4android SDK in your project
Two methods:
A. Directly import OpenCV jar package, use build Path->add library mode; (This method does not need to step 1)
B. Another way is to add android.library.reference.1= to the Project.Properties file. /.. /opencv-2.4.8.2-tegra-sdk/sdk/java (combined with step 1, direct reference)
3, the JNI partial modification
Add to Android.mk File: (critical section)
Include $ (clear_vars)
Opencv_camera_modules: = Off
Opencv_install_modules: = On
Opencv_lib_type: = SHARED
Include/home/ubuntu/nvpack/opencv-2.4.8.2-tegra-sdk/sdk/native/jni/opencv.mk
APPLICATION.MK files are the same as usual, as shown below
App_abi: = armeabi-v7a
App_platform: = android-19
App_stl: = gnustl_static
4, remove OpenCV dependence, if there are the following parts, should be removed
Private Baseloadercallback Mloadercallback = new Baseloadercallback (this) {
@Override
//.......
}

Opencvloader.initasync (Opencvloader.opencv_version_2_4_9, this, mloadercallback);
5. Add library (Key section)
static {
if (! Opencvloader.initdebug ()) {
LOG.I (TAG, "Opencvloader.initdebug () failed");
}else{
System.loadlibrary ("Opencv_java"); OpenCV's Library
System.loadlibrary ("Imageprocesslib"); Own Jin Compiled library
}
}

6. Compile and run

Go to Opencvmanager, most for reprint, only when you learn to use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.