Using OpenCV

To use opencv with android sudio and using the c tango api. Download opencv library for android from opencv for android . Download the c examples for [https://github.com/googlesamples/tango-examples-c]. Open hello-video example from c basic examples. edit the android.mk file to include

CVROOT := path_to_opencv/OpenCV-android-sdk/sdk/native/jni

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=STATIC
include $(CVROOT)/OpenCV.mk

Now we can include opencv like #include <opencv2/core/core.hpp> in hello_video_app.cc

On Lenovo Phab 2 Pro

CVROOT := path_to_opencv/OpenCV-android-sdk/sdk/native/jni

include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=STATIC (or SHARED)
include $(CVROOT)/OpenCV.mk

#if OPENCV_LIB_TYPE = SHARED
#for opencv 2.4.x
LOCAL_SHARED_LIBRARIES += libopencv_java
#for opencv 3.X
LOCAL_SHARED_LIBRARIES += libopencv_java3

#if OPENCV_LIB_TYPE = STATIC step above is not required

LOCAL_C_INCLUDES += $(CVROOT)/include

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License