Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Android add Native OpenCV

$
0
0
I made a console application in c++ and want to add it now to Android. I already configured everything and added a JNIInterface for my SourceFiles. After that I builded OpenCV Libraries for Android and added the following code from the Face-detection Example and configured it for my locations of the OpenCV.mk File. LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) #OPENCV_CAMERA_MODULES:=off #OPENCV_INSTALL_MODULES:=off #OPENCV_LIB_TYPE:=SHARED ifdef OPENCV_ANDROID ifneq ("","$(wildcard $(OPENCV_ANDROID_SDK)/OpenCV.mk)") include ${OPENCV_ANDROID)/OpenCV.mk else include ${OPENCV_ANDROID}/OpenCV.mk endif else include /Users/mtuchner/Desktop/opencv-master/platforms/build_android_arm/unix-install/OpenCV.mk endif LOCAL_SRC_FILES := ExtractorManager.cpp hpoint.cpp hrect.cpp JNIInterface.cpp kdnode.cpp kdtree.cpp KdtreeManager.cpp nnl.cpp priorityQueue.cpp LOCAL_C_INCLUDES += $(LOCAL_PATH) LOCAL_LDLIBS += -llog -ldl LOCAL_MODULE := fast_sift_detector include $(BUILD_SHARED_LIBRARY) Also I set the Application.mk: APP_STL := gnustl_static APP_CPPFLAGS := -frtti -fexceptions -std=c++11 APP_ABI := armeabi-v7a APP_PLATFORM := android-8 Then I started the building with the ndk-build But it seems, like I am missing something... it gives me this Errors, and says, that it cant find methods which I use in my sourcefiles. Does anyone know what is wrong there? Here is the complete Error Message: /Users/mtuchner/Library/Android/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lopencv_java3 /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:54: error: undefined reference to 'cv::hal::exp32f(float const*, float*, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:55: error: undefined reference to 'cv::hal::fastAtan2(float const*, float const*, float*, int, bool)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:56: error: undefined reference to 'cv::hal::magnitude32f(float const*, float const*, float*, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:145: error: undefined reference to 'cv::hal::fastAtan32f(float const*, float const*, float*, int, bool)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:146: error: undefined reference to 'cv::hal::magnitude32f(float const*, float const*, float*, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:147: error: undefined reference to 'cv::hal::exp32f(float const*, float*, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:254: error: undefined reference to 'cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_, double, double, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:256: error: undefined reference to 'cv::GaussianBlur(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_, double, double, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:258: error: undefined reference to 'cv::FAST(cv::_InputArray const&, std::vector>&, int, bool)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:260: error: undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const' /usr/local/include/opencv2/core/mat.inl.hpp:647: error: undefined reference to 'cv::Mat::copyTo(cv::_OutputArray const&) const' /usr/local/include/opencv2/core/mat.inl.hpp:687: error: undefined reference to 'cv::Mat::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:1182: error: undefined reference to 'cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.inl.hpp:687: error: undefined reference to 'cv::Mat::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:575: error: undefined reference to 'cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.inl.hpp:687: error: undefined reference to 'cv::Mat::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:575: error: undefined reference to 'cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.inl.hpp:687: error: undefined reference to 'cv::Mat::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:575: error: undefined reference to 'cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.inl.hpp:404: error: undefined reference to 'cv::Mat::copySize(cv::Mat const&)' /usr/local/include/opencv2/core/cvstd.inl.hpp:81: error: undefined reference to 'cv::String::allocate(unsigned int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:325: error: undefined reference to 'cv::imread(cv::String const&, int)' /usr/local/include/opencv2/core/cvstd.hpp:664: error: undefined reference to 'cv::String::deallocate()' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:331: error: undefined reference to 'cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:333: error: undefined reference to 'cv::Mat::copyTo(cv::_OutputArray const&) const' /Users/mtuchner/Desktop/FASTSIFT/app/src/main/jni/ExtractorManager.cpp:357: error: undefined reference to 'cv::KeyPointsFilter::removeDuplicated(std::vector>&)' /usr/local/include/opencv2/core/mat.inl.hpp:667: error: undefined reference to 'cv::Mat::create(int, int const*, int)' /usr/local/include/opencv2/core/cvstd.hpp:664: error: undefined reference to 'cv::String::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:596: error: undefined reference to 'cv::Mat::copySize(cv::Mat const&)' /usr/local/include/opencv2/core/cvstd.hpp:664: error: undefined reference to 'cv::String::deallocate()' /usr/local/include/opencv2/core/cvstd.hpp:664: error: undefined reference to 'cv::String::deallocate()' /usr/local/include/opencv2/core/mat.inl.hpp:404: error: undefined reference to 'cv::Mat::copySize(cv::Mat const&)' /usr/local/include/opencv2/core/mat.inl.hpp:404: error: undefined reference to 'cv::Mat::copySize(cv::Mat const&)' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [/Users/mtuchner/Desktop/FASTSIFT/app/src/main/obj/local/armeabi-v7a/libfast_sift_detector.so] Error 1

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>