Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Trouble setting up OpenCV with NDK in Android Studio

Hi, I would like to use OpenCV with the NDK in my Android Project. I am using Android Studio. I can't get it to compile properly. I am getting error while including opencv2 in my cpp file..... **

I followed all the steps. i copied all the native libs to my jniLibs

C:\fakepath\Capture1.PNG

My gradle looks like this

C:\fakepath\gradle.PNG

THIS IS MY Android.mk file

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=on

OPENCV_INSTALL_MODULES:=on

#OPENCV_LIB_TYPE:=STATIC

include F:/PULKIT/Resources/Android OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk

LOCALE_MODULE := ndkLib LOCAL_SRC_FILES := helloJNI.cpp

LOCAL_C_INCLUDES += F:/PULKIT/Resources/Android OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/include

LOCAL_LDLIBS += -llog -ldl

include $(BUILD_SHARED_LIBRARIES)

This is my Application.mk file

APP_STL := gnustl_static

APP_CPPFLAGS := -frtti -fexceptions

APP_ABI := armeabi-v7a

APP_PLATFORM := android-17

ERROR i am getting is

C:\fakepath\Capture.PNG

Trouble setting up OpenCV with NDK in Android Studio

Hi, I would like to use OpenCV with the NDK in my Android Project. I am using Android Studio. I can't get it to compile properly. I am getting error while including opencv2 in my cpp file..... **

I followed all the steps. i copied all the native libs to my jniLibs

C:\fakepath\Capture1.PNG

My gradle looks like this

C:\fakepath\gradle.PNG

THIS IS MY Android.mk file

LOCAL_PATH := $(call my-dir)

my-dir) include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=on

OPENCV_INSTALL_MODULES:=on

#OPENCV_LIB_TYPE:=STATIC

$(CLEAR_VARS) OPENCV_CAMERA_MODULES:=on OPENCV_INSTALL_MODULES:=on #OPENCV_LIB_TYPE:=STATIC include F:/PULKIT/Resources/Android OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk

OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk LOCALE_MODULE := ndkLib LOCAL_SRC_FILES := helloJNI.cpp

helloJNI.cpp LOCAL_C_INCLUDES += F:/PULKIT/Resources/Android OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/include

OpenCV/OpenCV-2.4.11-android-sdk/OpenCV-android-sdk/sdk/native/jni/include LOCAL_LDLIBS += -llog -ldl

-ldl include $(BUILD_SHARED_LIBRARIES)

$(BUILD_SHARED_LIBRARIES)

This is my Application.mk file

APP_STL := gnustl_static

gnustl_static APP_CPPFLAGS := -frtti -fexceptions

-fexceptions APP_ABI := armeabi-v7a

armeabi-v7a APP_PLATFORM := android-17

android-17

ERROR i am getting is

C:\fakepath\Capture.PNG