I'm trying to add the nonfree function to my android application in order to use SurfFeatureDetector and SurfDescritorExtractor.
For that I followed this tutorial but I first had the following error /libnonfree/jni/precomp.hpp:46:30: fatal error: opencv2/cvconfig.h: No such file or directory
which can be resolved by commenting the include line.
But now I've got this error /libnonfree/jni/precomp.hpp:66:42: fatal error: opencv2/ocl/private/util.hpp: No such file or directory
So I copied the C:\opencv\sources\modules\ocl\include\opencv2\ocl\private
and C:\opencv\sources\modules\ocl\include\opencv2\ocl\cl_runtime
folders to C:\OpenCV-android-sdk\sdk\native\jni\include\opencv2\ocl\
But now I get those errors :
/include/opencv2/ocl/private/util.hpp:65:8: error: 'cl_device_id' does not name a type
/include/opencv2/ocl/private/util.hpp:70:8: error: 'cl_context' does not name a type
/include/opencv2/ocl/private/util.hpp:75:8: error: 'cl_command_queue' does not name a type
... and so on
I am using cygwin to build the libnonfree and use it on adroid studio here is my Android.mk :
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES := on
OPENCV_CAMERA_MODULES := off
include C:\OpenCV-android-sdk\sdk\native\jni\OpenCV.mk
LOCAL_C_INCLUDE := C:\OpenCV-android-sdk\sdk\native\jni\include
LOCAL_SRC_FILES := nonfree_init.cpp sift.cpp surf.cpp
LOCAL_MODULE := nonfree
LOCAL_CFLAGS := -Werror -O3 -ffast-math
LOCAL_LDLIBS := -llog -ldl
include $(BUILD_SHARED_LIBRARY)
Can someone explain me what am I doing wrong ? Thanks