GithubHelp home page GithubHelp logo

randauto / opencv-android-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jlhonora/opencv-android-sample

0.0 1.0 0.0 93 KB

Sample setup for OpenCV + NDK in Android Studio

License: MIT License

Java 71.17% C++ 28.83%

opencv-android-sample's Introduction

OpenCV Example

Based on OpenCV's Tutorial #1.

OpenCV installation

Based on this

  1. Download latest OpenCV sdk for Android from OpenCV.org and decompress the zip file.
  2. Import OpenCV to Android Studio, From File -> New -> Import Module, choose sdk/java folder in the unzipped opencv archive.
  3. Update build.gradle under imported OpenCV module to update 4 fields to match your project build.gradle a) compileSdkVersion b) buildToolsVersion c) minSdkVersion and 4) targetSdkVersion.
  4. Add module dependency by Application -> Module Settings, and select the Dependencies tab. Click + icon at bottom, choose Module Dependency and select the imported OpenCV module.
  5. For Android Studio v1.2.2, to access to Module Settings : in the project view, right-click the dependent module -> Open Module Settings
  6. Copy libs folder under sdk/native to Android Studio under app/src/main.
  7. In Android Studio, rename the copied libs directory to jniLibs and we are done.

Setup NDK

Download and install Android's Native Development Kit (NDK). More info here: https://developer.android.com/ndk/guides/setup.html

Notes

This project uses the gradle experimental plugin, so it is subject to change.

Your local.properties file must define the ndk and opencv dirs. Here's mine as an example

sdk.dir=~/Library/Android/sdk
ndk.dir=/usr/local/android-ndk-r10e
opencv.dir=~/dev/androidstudio/OpenCV-android-sdk/sdk/native/jni/include

opencv-android-sample's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.