2

您好我在尝试编译我的代码时遇到问题:

d:/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi
/4.6/../../../../arm-linux-androideabi/bin/ld.exe: D:/Workspace/project//obj/local/armeabi/objs/
matcher/matcher.o: in function createDetectorDescriptorMatcher:D:\Workspace\project/jni/matcher.cpp:92:
error: undefined reference to 'cv::initModule_nonfree()'

添加了代码行 cv::initModule_nonfree();但不起作用。

我的 android.mk 文件:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

OPENCV_LIB_TYPE := STATIC

OPENCV_CAMERA_MODULES:=on 
OPENCV_INSTALL_MODULES:=on

include D:/Workspace/Android/OpenCV-2.4.5-android-sdk/sdk/native/jni/OpenCV.mk

LOCAL_MODULE    := matcher
LOCAL_SRC_FILES := matcher.cpp
LOCAL_LDLIBS +=  -llog -ldl

include $(BUILD_SHARED_LIBRARY)

我的 application.mk 文件:

APP_OPTIM := release

APP_STL := gnustl_static

APP_CPPFLAGS := -frtti -fexceptions

APP_ABI := armeabi armeabi-v7a x86 mips

APP_PLATFORM := android-10

APP_PROJECT_PATH := D:\Workspace\Project

请帮助我,我不知道是哪个问题。谢谢!

我想使用 SURF 比较两个图像:

cv::initModule_nonfree();

featureDetector = FeatureDetector::create( detectorType );
descriptorExtractor = DescriptorExtractor::create( descriptorType );
descriptorMatcher = DescriptorMatcher::create( matcherType );

bool isCreated = !( featureDetector.empty() || descriptorExtractor.empty() || descriptorMatcher.empty() );

if( !isCreated )
  cout << "Can not create feature detector or descriptor extractor or descriptor matcher of given types." << endl << ">" << endl;

return isCreated;
4

0 回答 0