我从github repo
合并了opencv和opencv-contrib我的操作系统是Windows 8.1
请按以下步骤操作:
opencv (Itseez/opencv)
opencv_contrib (Itseez/opencv_contrib)
D:\opencv_merge\opencv-master
D:\opencv_merge\opencv_contrib-master
(1)
Open CMake GUI
setting path
source code: D:\opencv_merge\opencv-master
build the binaries: D:\opencv_merge\opencv-master\build
(2)
press 'Configure'
wait for 'Configuring done'
watch output
---------------------
OpenCV modules:
To be built: core flann hdf imgproc ml photo reg surface_matching video dnn fuzzy imgcodecs shape videoio highgui objdetect plot superres ts xobjdetect xphoto bgsegm bioinspired dpm face features2d line_descriptor saliency text calib3d ccalib datasets rgbd stereo structured_light tracking videostab xfeatures2d ximgproc aruco java optflow stitching matlab python2
Disabled: world contrib_world
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python3 viz cvv sfm
Java:
ant: C:/apache-ant-1.9.7/bin/ant.bat (ver 1.9.7)
JNI: C:/Program Files/Java/jdk1.8.0_91/include C:/Program Files/Java/jdk1.8.0_91/include/win32 C:/Program Files/Java/jdk1.8.0_91/include
Java wrappers: YES
Java tests: YES
D:/opencv_merge/opencv_contrib-master/modules
press 'Configure'
watch output double check again
在'Solution Explorer' CMakeTargets-->Install -->Right Click -->Build
(D:\opencv_merge\opencv-master\build\install\java)
(1) add Opencv Library (add opencv-310.jar to Library)
(2) VM options: -Djava.library.path=D:\opencv_merge\opencv-master\build\install\java
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
.....
FeatureDetector orbDetector = FeatureDetector.create(FeatureDetector.ORB);
.....
FeatureDetector siftDetector = FeatureDetector.create(FeatureDetector.SIFT);
.....
FeatureDetector surfDetector = FeatureDetector.create(FeatureDetector.SURF);
}
ORB检测器可以执行(当然)
但是SIFT和SURF探测器不能
我看到这种情绪后做了一些修改:(SURF and SIFT algorithms doesn't work in OpenCV 3.0 Java)
我根据上述网址编辑'D:\opencv_merge\opencv-master\modules\features2d\misc\java\src\cpp\features2d_manual.hpp'
,然后开始第二步。
然而,在第五步中,在java文件夹(D:\opencv_merge\opencv-master\build\install\java
)中找不到'opencv_java310.dll'
我尝试重复相同的步骤至少5次,但仍然没有'opencv_java310.dll'
原因似乎是我手动更改了'features2d_manual.hpp'
我整天都在外面:(
谁能帮我解决这个问题
谢谢你们
答案 0 :(得分:1)
猜测您的问题是您需要在手动修改features2d_manual.hpp
后重新编译。这对我有用。
您可以在“SURF and SIFT algorithms doesn't work in OpenCV 3.0 Java”
中查看我的答案