Android

OpenCV on Android: practices and tips

Transfer MAT objects from Android to NDK The main idea is to use the address of an MAT object in order to manipulate the data. Basically, we have a function playing as a bridge between Java APIs and NDK: public native void function_name(long matAddress); To call the function, we use Mat’s address by calling getNativeObjAddr(). All computations in NDK will affect the content of MAT in both Java and NDK layers.

Setup OpenCV and Android Studio with NDK support

In this tutorial, I will demonstrate how to configurate the renowned computer vision libary, OpenCV, with the current Android Studio version (3.0.1). Let get started. The compiled version of OpenCV which supports Android is available at OpenCV Homepage. Download and extract it. Please note that to test the application properly on the mobile devices, the OpenCV Manager has to be installed. In another tutorial, I will talk about how to compile our own OpenCV library and put it to Android Studio since the pre-compiled library misses some interesting and important components, e.