本文介绍了的Andr​​oid NDK给予的错误,同时在Eclipse编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我在Eclipse的Andr​​oid应用程序的Andr​​oid.mk文件。

  LOCAL_PATH:= $(叫我-DIR)



包括$(CLEAR_VARS)

OPENCV_CAMERA_MODULES:=关闭

OPENCV_MK_PATH:=C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\OpenCV.mk


OPENCV_LIB_TYPE:= STATIC
OPENCV_INSTALL_MODULES:=上

包括$(OPENCV_MK_PATH)

#Profiler
#-include android-ndk-profiler.mk

#包括../includeOpenCV.mk
#ifeq($(通配符$(OPENCV_MK_PATH)),)
##try加载OpenCV.mk从默认的安装位置
#包括$(TOOLCHAIN​​_ preBUILT_ROOT)/user/share/OpenCV/OpenCV.mk
#其他
#包括$(OPENCV_MK_PATH)
#ENDIF

LOCAL_C_INCLUDES:= C:\ Users \用户rabbia \下载\ OpenCV300androidsdk1 \ OpenCV的,Android的SDK \ SDK \本地\ JNI \包括

LOCAL_MODULE:= native_wallet
LOCAL_SRC_FILES:= jni_recognizer.cpp NativeVision / vision.cpp
LOCAL_CFLAGS = -ffast,数学-O3 -funroll-循环
#LOCAL_CFLAGS = -O3 -funroll-循环

LOCAL_LDLIBS + = -llog -ldl

#Profiling
#LOCAL_CFLAGS:= -pg
#LOCAL_STATIC_LIBRARIES:= andprof


包括$(BUILD_SHARED_LIBRARY)
 

更新所述opencv_mk_path和LOCAL_C_INCLUDES后,将应用程序没有编译NDK通过。我曾尝试各种可能的解决方案,但没有运气。以下是发生错误:

 的Andr​​oid NDK:警告:APP_PLATFORM的android-19是比Android大:的minSdkVersion 8 ./AndroidManifest.xml
[armeabi-V7A] ++编译大拇指:native_wallet< = jni_recognizer.cpp
JNI / jni_recognizer.cpp:在函数'无效Java_com_ndu_mobile_darwinwallet_Recognizer_nvTrainImage(的JNIEnv *,jobject,的jstring,的jstring):
JNI / jni_recognizer.cpp:18:88:警告:格式字符串不是一个字面,没有格式参数[-Wformat安全]
 #定义LOGD(...)__android_log_print(ANDROID_LOG_DEBUG,JNI_DEBUGGING,__VA_ARGS__)
                                                                                        ^
JNI / jni_recognizer.cpp:78:3:注意:在扩展宏LOGD
   LOGD(out.str()c_str());
   ^
JNI / jni_recognizer.cpp:18:88:警告:格式字符串不是一个字面,没有格式参数[-Wformat安全]
 #定义LOGD(...)__android_log_print(ANDROID_LOG_DEBUG,JNI_DEBUGGING,__VA_ARGS__)
                                                                                        ^
JNI / jni_recognizer.cpp:89:3:注意:在扩展宏LOGD
   LOGD(out.str()c_str());
   ^
JNI / jni_recognizer.cpp:在函数'_jstring * Java_com_ndu_mobile_darwinwallet_Recognizer_nvRecognize(的JNIEnv *,jobject,jint,jint,jbyteArray):
JNI / jni_recognizer.cpp:18:88:警告:格式字符串不是一个字面,没有格式参数[-Wformat安全]
 #定义LOGD(...)__android_log_print(ANDROID_LOG_DEBUG,JNI_DEBUGGING,__VA_ARGS__)
                                                                                        ^
JNI / jni_recognizer.cpp:216:4:注意:在扩展宏LOGD
    LOGD((字符*)out.str()c_str());
    ^
[armeabi-V7A] ++编译大拇指:native_wallet< = vision.cpp
JNI / NativeVision / vision.cpp:在功能上简历:: PTR< CV :: ORB> getQueryDetector()':
JNI / NativeVision / vision.cpp:18:76:错误:无法分配抽象类型的对象CV :: ORB
     PTR< ORB> detector1 =新的ORB(DEFAULT_QUERY_FEATURES,1.2F,5U,10,1,2);
                                                                            ^
在文件中包括来自C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d.hpp:48:0,
                 从C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d/calib3d.hpp:48,
                 从JNI / NativeVision / vision.h:2,
                 从JNI / NativeVision / vision.cpp:1:
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:254:20:注:由于以下虚拟函数是在简历:: ORB纯:
 类CV_EXPORTS_W ORB:公共Feature2D
                    ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:292:26:注意:虚拟无效简历:: ORB :: setMaxFeatures(INT)
     CV_WRAP虚拟无效setMaxFeatures(INT maxFeatures)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:293:25:注意:虚拟INT简历:: ORB :: getMaxFeatures()const的
     CV_WRAP虚拟INT getMaxFeatures()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:295:26:注意:虚拟无效简历:: ORB :: setScaleFactor(双)
     CV_WRAP虚拟无效setScaleFactor(双比例因子)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:296:28:注:虚拟双CV :: ORB :: getScaleFactor()const的
     CV_WRAP虚拟双getScaleFactor()常量= 0;
                            ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:298:26:注意:虚拟无效简历:: ORB :: setNLevels(INT)
     CV_WRAP虚拟无效setNLevels(NLEVELS INT)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:299:25:注意:虚拟INT简历:: ORB :: getNLevels()const的
     CV_WRAP虚拟INT getNLevels()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:301:26:注意:虚拟无效简历:: ORB :: setEdgeThreshold(INT)
     CV_WRAP虚拟无效setEdgeThreshold(INT edgeThreshold)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:302:25:注意:虚拟INT简历:: ORB :: getEdgeThreshold()const的
     CV_WRAP虚拟INT getEdgeThreshold()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:304:26:注意:虚拟无效简历:: ORB :: setFirstLevel(INT)
     CV_WRAP虚拟无效setFirstLevel(INT firstLevel)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:305:25:注意:虚拟INT简历:: ORB :: getFirstLevel()const的
     CV_WRAP虚拟INT getFirstLevel()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:307:26:注意:虚拟无效简历:: ORB :: setWTA_K(INT)
     CV_WRAP虚拟无效setWTA_K(INT wta_k)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:308:25:注意:虚拟INT简历:: ORB :: getWTA_K()const的
     CV_WRAP虚拟INT getWTA_K()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:310:26:注意:虚拟无效简历:: ORB :: setScoreType(INT)
     CV_WRAP虚拟无效setScoreType(INT scoreType)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:311:25:注意:虚拟INT简历:: ORB :: getScoreType()const的
     CV_WRAP虚拟INT getScoreType()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:313:26:注意:虚拟无效简历:: ORB :: setPatchSize(INT)
     CV_WRAP虚拟无效setPatchSize(INT patchSize)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:314:25:注意:虚拟INT简历:: ORB :: getPatchSize()const的
     CV_WRAP虚拟INT getPatchSize()常量= 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:316:26:注意:虚拟无效简历:: ORB :: setFastThreshold(INT)
     CV_WRAP虚拟无效setFastThreshold(INT fastThreshold)= 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:317:25:注意:虚拟INT简历:: ORB :: getFastThreshold()const的
     CV_WRAP虚拟INT getFastThreshold()常量= 0;
                         ^
JNI / NativeVision / vision.cpp:在功能上简历:: PTR< CV :: ORB> getTrainerDetector(INT):
JNI / NativeVision / vision.cpp:29:76:错误:无法分配抽象类型的对象CV :: ORB
     PTR< ORB> detector2 =新的ORB(DEFAULT_QUERY_FEATURES,1.2F,5U,10,1,2);
                                                                            ^
在文件中包括来自C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d.hpp:48:0,
                 从C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d/calib3d.hpp:48,
                 从JNI / NativeVision / vision.h:2,
                 从JNI / NativeVision / vision.cpp:1:
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:254:20:注意:由于式的简历:: ORB有纯虚函数
 类CV_EXPORTS_W ORB:公共Feature2D
                    ^
JNI / NativeVision / vision.cpp:在功能上简历::垫trainImage(常量CV ::垫和放大器;,CV :: PTR< CV :: ORB>&安培;,CV :: PTR< CV :: DescriptorMatcher>&安培;) :
JNI / NativeVision / vision.cpp:149:24:错误:'类品种:: ORB没有成员命名为操作符()
     的检测器>运营商()(IMG,CV :: noArray(),关键点描述,FALSE);
                        ^
JNI / NativeVision / vision.cpp:在函数'RecognitionResult识别(常量CV ::垫和放大器;,布尔,CV ::垫*,CV :: PTR< CV :: ORB>&安培;,CV :: PTR< CV :: DescriptorMatcher>&放;,的std ::矢量<的std :: basic_string的<焦炭>>&安培;,BOOL,INT *)':
JNI / NativeVision / vision.cpp:177:24:错误:'类品种:: ORB没有成员命名为操作符()
     的检测器>运营商()(queryImg,CV :: noArray(),queryKeypoints,queryDescriptors,假);
                        ^
make.exe:*** [OBJ /本地/ armeabi-V7A / OBJ文件/ native_wallet / NativeVision / vision.o]错误1
 

请帮我出这一点。

解决方案
  1. LOGD(),用

    LOGD(%s时,out.str()c_str());

  2. 获得 PTR< ORB> detector1 ,你应该使用 ORB ::创建(),不是新的ORB()

Following is the Android.mk file of my android application in eclipse.

    LOCAL_PATH := $(call my-dir)



include $(CLEAR_VARS)

OPENCV_CAMERA_MODULES := off

OPENCV_MK_PATH:=C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\OpenCV.mk


OPENCV_LIB_TYPE:=STATIC
OPENCV_INSTALL_MODULES:=on

include $(OPENCV_MK_PATH)

#Profiler 
#-include android-ndk-profiler.mk

#include ../includeOpenCV.mk
#ifeq ("$(wildcard $(OPENCV_MK_PATH))","")
#   #try to load OpenCV.mk from default install location
#   include $(TOOLCHAIN_PREBUILT_ROOT)/user/share/OpenCV/OpenCV.mk
#else
#   include $(OPENCV_MK_PATH)
#endif

LOCAL_C_INCLUDES := C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include

LOCAL_MODULE    := native_wallet
LOCAL_SRC_FILES := jni_recognizer.cpp NativeVision/vision.cpp
LOCAL_CFLAGS=-ffast-math -O3 -funroll-loops
#LOCAL_CFLAGS=-O3 -funroll-loops

LOCAL_LDLIBS +=  -llog -ldl

#Profiling
#LOCAL_CFLAGS := -pg
#LOCAL_STATIC_LIBRARIES := andprof


include $(BUILD_SHARED_LIBRARY)

After updating the opencv_mk_path and local_c_includes, the application is not compiling through ndk. I have tried every possible solution but no luck. Following are the errors that occured:

Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml    
[armeabi-v7a] Compile++ thumb: native_wallet <= jni_recognizer.cpp
jni/jni_recognizer.cpp: In function 'void Java_com_ndu_mobile_darwinwallet_Recognizer_nvTrainImage(JNIEnv*, jobject, jstring, jstring)':
jni/jni_recognizer.cpp:18:88: warning: format not a string literal and no format arguments [-Wformat-security]
 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,   "JNI_DEBUGGING", __VA_ARGS__)
                                                                                        ^
jni/jni_recognizer.cpp:78:3: note: in expansion of macro 'LOGD'
   LOGD( out.str().c_str() );
   ^
jni/jni_recognizer.cpp:18:88: warning: format not a string literal and no format arguments [-Wformat-security]
 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,   "JNI_DEBUGGING", __VA_ARGS__)
                                                                                        ^
jni/jni_recognizer.cpp:89:3: note: in expansion of macro 'LOGD'
   LOGD( out.str().c_str() );
   ^
jni/jni_recognizer.cpp: In function '_jstring* Java_com_ndu_mobile_darwinwallet_Recognizer_nvRecognize(JNIEnv*, jobject, jint, jint, jbyteArray)':
jni/jni_recognizer.cpp:18:88: warning: format not a string literal and no format arguments [-Wformat-security]
 #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,   "JNI_DEBUGGING", __VA_ARGS__)
                                                                                        ^
jni/jni_recognizer.cpp:216:4: note: in expansion of macro 'LOGD'
    LOGD( (char*) out.str().c_str());
    ^
[armeabi-v7a] Compile++ thumb: native_wallet <= vision.cpp
jni/NativeVision/vision.cpp: In function 'cv::Ptr<cv::ORB> getQueryDetector()':
jni/NativeVision/vision.cpp:18:76: error: cannot allocate an object of abstract type 'cv::ORB'
     Ptr<ORB> detector1 = new ORB(DEFAULT_QUERY_FEATURES, 1.2f, 5U, 10, 1, 2);
                                                                            ^
In file included from C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d.hpp:48:0,
                 from C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d/calib3d.hpp:48,
                 from jni/NativeVision/vision.h:2,
                 from jni/NativeVision/vision.cpp:1:
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:254:20: note:   because the following virtual functions are pure within 'cv::ORB':
 class CV_EXPORTS_W ORB : public Feature2D
                    ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:292:26: note:   virtual void cv::ORB::setMaxFeatures(int)
     CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:293:25: note:   virtual int cv::ORB::getMaxFeatures() const
     CV_WRAP virtual int getMaxFeatures() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:295:26: note:   virtual void cv::ORB::setScaleFactor(double)
     CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:296:28: note:   virtual double cv::ORB::getScaleFactor() const
     CV_WRAP virtual double getScaleFactor() const = 0;
                            ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:298:26: note:   virtual void cv::ORB::setNLevels(int)
     CV_WRAP virtual void setNLevels(int nlevels) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:299:25: note:   virtual int cv::ORB::getNLevels() const
     CV_WRAP virtual int getNLevels() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:301:26: note:   virtual void cv::ORB::setEdgeThreshold(int)
     CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:302:25: note:   virtual int cv::ORB::getEdgeThreshold() const
     CV_WRAP virtual int getEdgeThreshold() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:304:26: note:   virtual void cv::ORB::setFirstLevel(int)
     CV_WRAP virtual void setFirstLevel(int firstLevel) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:305:25: note:   virtual int cv::ORB::getFirstLevel() const
     CV_WRAP virtual int getFirstLevel() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:307:26: note:   virtual void cv::ORB::setWTA_K(int)
     CV_WRAP virtual void setWTA_K(int wta_k) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:308:25: note:   virtual int cv::ORB::getWTA_K() const
     CV_WRAP virtual int getWTA_K() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:310:26: note:   virtual void cv::ORB::setScoreType(int)
     CV_WRAP virtual void setScoreType(int scoreType) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:311:25: note:   virtual int cv::ORB::getScoreType() const
     CV_WRAP virtual int getScoreType() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:313:26: note:   virtual void cv::ORB::setPatchSize(int)
     CV_WRAP virtual void setPatchSize(int patchSize) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:314:25: note:   virtual int cv::ORB::getPatchSize() const
     CV_WRAP virtual int getPatchSize() const = 0;
                         ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:316:26: note:   virtual void cv::ORB::setFastThreshold(int)
     CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0;
                          ^
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:317:25: note:   virtual int cv::ORB::getFastThreshold() const
     CV_WRAP virtual int getFastThreshold() const = 0;
                         ^
jni/NativeVision/vision.cpp: In function 'cv::Ptr<cv::ORB> getTrainerDetector(int)':
jni/NativeVision/vision.cpp:29:76: error: cannot allocate an object of abstract type 'cv::ORB'
     Ptr<ORB> detector2 = new ORB(DEFAULT_QUERY_FEATURES, 1.2f, 5U, 10, 1, 2);
                                                                            ^
In file included from C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d.hpp:48:0,
                 from C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/calib3d/calib3d.hpp:48,
                 from jni/NativeVision/vision.h:2,
                 from jni/NativeVision/vision.cpp:1:
C:\Users\rabbia\Downloads\OpenCV300androidsdk1\OpenCV-android-sdk\sdk\native\jni\include/opencv2/features2d.hpp:254:20: note:   since type 'cv::ORB' has pure virtual functions
 class CV_EXPORTS_W ORB : public Feature2D
                    ^
jni/NativeVision/vision.cpp: In function 'cv::Mat trainImage(const cv::Mat&, cv::Ptr<cv::ORB>&, cv::Ptr<cv::DescriptorMatcher>&)':
jni/NativeVision/vision.cpp:149:24: error: 'class cv::ORB' has no member named 'operator()'
     detector->operator()( img, cv::noArray(), keypoints, descriptors, false );
                        ^
jni/NativeVision/vision.cpp: In function 'RecognitionResult recognize(const cv::Mat&, bool, cv::Mat*, cv::Ptr<cv::ORB>&, cv::Ptr<cv::DescriptorMatcher>&, std::vector<std::basic_string<char> >&, bool, int*)':
jni/NativeVision/vision.cpp:177:24: error: 'class cv::ORB' has no member named 'operator()'
     detector->operator()( queryImg, cv::noArray(), queryKeypoints, queryDescriptors, false );
                        ^
make.exe: *** [obj/local/armeabi-v7a/objs/native_wallet/NativeVision/vision.o] Error 1

Please help me out with this.

解决方案
  1. for LOGD(), use

    LOGD("%s", out.str().c_str());

  2. to get Ptr<ORB> detector1, you should use ORB::create(), not new ORB().

这篇关于的Andr​​oid NDK给予的错误,同时在Eclipse编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 22:52