• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Java
  • Created almost 9 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Android Library Project for OpenCV (currently v3.x.y)

opencv-android

OpenCV4Android, packaged as a .aar for direct use without depending on the stupid OpenCV Manager app.

Building an .aar of OpenCV-3.x.y for yourself

Building OpenCV-3.x.y for Android is actually quite simple, its just not obvious where to get the pieces and the OpenCV docs hard-sell the "OpenCV Manager" in favour of the better and easier direct integration approach.

Here's the steps I used to create my .aar:

  1. Download and extract the OpenCV4Android bundle
  2. Create a Library Project in Android Studio
  3. Copy the java source files from OpenCV4Android into src/main/java
  4. Drop the OpenCV native libraries into src/main/jniLibs
  5. Run the gradle build
  6. Et voila, .aar file

Using your glorious new .aar

Reference the maven repository you've deployed your .aar to, e.g. mine (which I can't stop you from using ;)) is:

allprojects {
  repositories {
    jcenter()
    maven {
       url  "http://dl.bintray.com/steveliles/maven" 
    }
  }
}

Include the .aar in your build.gradle file:

dependencies {
  compile 'org.opencv:OpenCV-Android:3.1.0'
}

Bootstrap OpenCV in your Java code:

import org.opencv.android.OpenCVLoader;

...

if (OpenCVLoader.initDebug()) {
  // do some opencv stuff
}

Optional but recommended: to keep the downloaded APK size to a minimum, build separate APK's per architecture (approx 10MB each vs 42MB for universal) by placing the following inside the 'android' gradle directive of your application's build.gradle:

splits {
  abi {
    enable true
    reset()
    include 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'arm64-v8a'
    universalApk false
  }
}

Disclaimer: This project is simply my bundling of OpenCV as an Android Library. I am not otherwise involved in the OpenCV project, and all credit for the wonderful OpenCV library goes to the developers thereof.

More Repositories

1

Foredroid

Utility for detecting and notifying when your Android app goes background / becomes foreground
Java
153
star
2

jetty-embedded-spring-mvc

Example project for setting up embedded Jetty 9 with Spring-MVC, JSP and JSTL support (uses Maven).
Java
66
star
3

AsyncAndroid

Example code for Android Concurrency book (ISBN 978-1-78328-687-4)
Java
42
star
4

jetty-embedded-spring-mvc-noxml

Jetty 8 embedded / Spring-MVC 3.1.2 - no xml configuration
Java
33
star
5

react-native-circular-slider-example

A bit of React-Native SVG fun, inspired by a stackoverflow question
Objective-C
30
star
6

Android-Download-Service-Example

An example of implementing RSS downloads using an IntentService - see http://stackoverflow.com/questions/6343166/android-os-networkonmainthreadexception
Java
30
star
7

dsl4xml

Easy and fast marshalling of XML And JSON to Java objects via a DSL that mirrors the document structure.
Java
28
star
8

nextjs-nested-layouts

JavaScript
14
star
9

dsl4xml-perf

Performance & comparison tests for dsl4xml
Java
8
star
10

vectoriser

bitmap to svg tracer, written in java
Java
7
star
11

sjl.io

IO utils (java)
Java
5
star
12

implicit-futures

experimental implementation of implicit futures in java (using dynamic proxies and java's explicit java.util.concurrent.Future)
Java
5
star
13

manual-ntlm

node.js scripts to help with manually testing NTLM auth via telnet / openssl
JavaScript
3
star
14

gwt-progressive

Progressive Enhancement lib for GWT
Java
2
star
15

sjl.util

simple utility classes (java)
Java
2
star
16

gwt-rubiks

3d rubiks cube rendered on html canvas using javascript (via GWT)
Java
2
star
17

circular-slider-expo

ReactNative circular slider example (expo version)
JavaScript
2
star
18

vagrant-boxes

some handy vagrant box definitions
Shell
2
star
19

sjl.testing

Some test-related utils
Java
2
star
20

dsl4xml-perf-android

Android project for running dsl4xml perf tests on a device
Java
2
star
21

steveliles.github.com

my blog
HTML
1
star
22

sjl.regex

regex based utils (java)
Java
1
star
23

Artwork

Graphics and Artwork
Shell
1
star
24

kafkaish

Poor-man's Apache-Kafka - replay-able publish/subscribe event streams on MongoDB
JavaScript
1
star