How to use OpenCV in Android Studio

Source: Internet
Author: User

How to use OpenCV in Android Studio
  • Create AlibrariesFolder underneath your project main directory. For example, if your project isOpenCVExamples, you would create aOpenCVExamples/librariesFolder.

  • Go To the location where you have the SDK "\OPENCV-2.4.8-ANDROID-SDK\SDK" Here you'll find The java  folder, rename it to opencv .

  • Now create a file in the directory with the build.gradle opencv following contents

    Apply Plugin: ' Android-library 'Buildscript{repositories{mavencentral()    }Dependencies{Classpath' com.android.tools.build:gradle:0.9.+ '    }}Android{compilesdkversion +buildtoolsversion"19.0.1"Defaultconfig{minsdkversion8targetsdkversion +Versioncode2480Versionname"2.4.8"    }sourcesets{Main{Manifest.Srcfile' Androidmanifest.xml 'Java.Srcdirs= [' src ']Resources.Srcdirs= [' src ']Res.Srcdirs= [' Res ']Aidl.Srcdirs= [' src ']        }    }}
  • Edit Your Settings.gradle file in your application ' s main directory and add this line:

    include   ': Libraries:opencv '   
  • open module Settings  then Choose Modules from the left-hand list, click on your application ' s Module, click O n the Dependencies tab, and click on the + button to add a new module dependency.

    /li>

  • Choose Module dependency . It would open a dialog with a list of modules to choose from; Select ": Libraries:opencv".

  • Create AjniLibsFolder in the/app/src/main/Location and copy the "the" folder with *.so files (Armeabi, ARMEABI-V7A, MIPS, x86) in thejniLibsFrom the OpenCV SDK.

  • Click OK. Now everything do, go and enjoy with OpenCV.



  • or view this link: http://www.bubuko.com/infodetail-949520.html

  • Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

    How to use OpenCV in Android Studio

    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.