I try to run this project from github使用eclipse和cygwin。
除了Android.mk之外,我没有更改项目。
但是我无法运行它,因为ndk-build
无效。
make: Entering directory `C:/Users/TL/Desktop/panorama-HDR-opencv-master/panoram a-HDR-opencv-master/code'
[armeabi-v7a] Compile++ thumb: PanoHDR <= PanoHDR.cpp
[armeabi-v7a] Compile++ thumb: PanoHDR <= Panorama.cpp
jni/Panorama.cpp: In function 'void find_correspondences(std::vector<cv::Mat>, s td::vector<std::vector<cv::Point_<float> > >&, std::string, bool)':
jni/Panorama.cpp:26:20: error: no matching function for call to 'cv::ORB::ORB(in t)'
ORB detector (2000);
^
jni/Panorama.cpp:26:20: note: candidates are:
In file included from /Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/n ative/jni/include/opencv2/opencv.hpp:50:0,
from jni/Panorama.cpp:1:
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: cv::ORB::ORB()
class CV_EXPORTS_W ORB : public Feature2D
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: candidate expects 0 arguments, 1 provided
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: cv::ORB::ORB(const cv::ORB&)
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: no known conversion for argument 1 from 'int' to 'const cv::ORB&'
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: cv::ORB::ORB(cv::ORB&&)
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: no known conversion for argument 1 from 'int' to 'cv::ORB&&'
jni/Panorama.cpp:26:6: error: cannot declare variable 'detector' to be of abstra ct type 'cv::ORB'
ORB detector (2000);
^
In file included from /Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/n ative/jni/include/opencv2/opencv.hpp:50:0,
from jni/Panorama.cpp:1:
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:254:20: note: because the following virtual functions are p ure within 'cv::ORB':
class CV_EXPORTS_W ORB : public Feature2D
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:292:26: note: virtual void cv::ORB::setMaxFeatures(int )
CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:293:25: note: virtual int cv::ORB::getMaxFeatures() co nst
CV_WRAP virtual int getMaxFeatures() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:295:26: note: virtual void cv::ORB::setScaleFactor(dou ble)
CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:296:28: note: virtual double cv::ORB::getScaleFactor() const
CV_WRAP virtual double getScaleFactor() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:298:26: note: virtual void cv::ORB::setNLevels(int)
CV_WRAP virtual void setNLevels(int nlevels) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:299:25: note: virtual int cv::ORB::getNLevels() const
CV_WRAP virtual int getNLevels() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:301:26: note: virtual void cv::ORB::setEdgeThreshold(i nt)
CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:302:25: note: virtual int cv::ORB::getEdgeThreshold() const
CV_WRAP virtual int getEdgeThreshold() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:304:26: note: virtual void cv::ORB::setFirstLevel(int)
CV_WRAP virtual void setFirstLevel(int firstLevel) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:305:25: note: virtual int cv::ORB::getFirstLevel() con st
CV_WRAP virtual int getFirstLevel() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:307:26: note: virtual void cv::ORB::setWTA_K(int)
CV_WRAP virtual void setWTA_K(int wta_k) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:308:25: note: virtual int cv::ORB::getWTA_K() const
CV_WRAP virtual int getWTA_K() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:310:26: note: virtual void cv::ORB::setScoreType(int)
CV_WRAP virtual void setScoreType(int scoreType) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:311:25: note: virtual int cv::ORB::getScoreType() cons t
CV_WRAP virtual int getScoreType() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:313:26: note: virtual void cv::ORB::setPatchSize(int)
CV_WRAP virtual void setPatchSize(int patchSize) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:314:25: note: virtual int cv::ORB::getPatchSize() cons t
CV_WRAP virtual int getPatchSize() const = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:316:26: note: virtual void cv::ORB::setFastThreshold(i nt)
CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0;
^
/Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/include/open cv2/features2d.hpp:317:25: note: virtual int cv::ORB::getFastThreshold() const
CV_WRAP virtual int getFastThreshold() const = 0;
^
jni/Panorama.cpp:33:61: error: no match for call to '(cv::ORB) (__gnu_cxx::__all oc_traits<std::allocator<cv::Mat> >::value_type&, cv::Mat, __gnu_cxx::__alloc_tr aits<std::allocator<std::vector<cv::KeyPoint> > >::value_type&, __gnu_cxx::__all oc_traits<std::allocator<cv::Mat> >::value_type&)'
detector(inputImages[0], Mat(), keypoints[0],descriptors[0]);
^
jni/Panorama.cpp:35:62: error: no match for call to '(cv::ORB) (__gnu_cxx::__all oc_traits<std::allocator<cv::Mat> >::value_type&, cv::Mat, __gnu_cxx::__alloc_tr aits<std::allocator<std::vector<cv::KeyPoint> > >::value_type&, __gnu_cxx::__all oc_traits<std::allocator<cv::Mat> >::value_type&)'
detector(inputImages[i], Mat(), keypoints[i],descriptors[i]);
^
make: *** [obj/local/armeabi-v7a/objs/PanoHDR/Panorama.o] Error 1
make: Leaving directory `C:/Users/TL/Desktop/panorama-HDR-opencv-master/panorama -HDR-opencv-master/code'
这是我编辑的Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_LIB_TYPE=STATIC
# Tegra optimized OpenCV.mk
include /Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
# Linker
LOCAL_LDLIBS += -llog
# Our module sources
LOCAL_MODULE := PanoHDR
LOCAL_SRC_FILES := PanoHDR.cpp Panorama.cpp HDR.cpp NativeLogging.cpp
include $(BUILD_SHARED_LIBRARY)
谁能告诉我哪里出错了? 谢谢。