gpt4 book ai didi

java - SURF 和 SIFT 算法在 Open CV 3.0 Java 中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 21:44:19 26 4
gpt4 key购买 nike

我从 github repo 合并 opencv 和 opencv-contrib

我的操作系统是 Windows 8.1

进行如下操作:

1.下载Github Repo。

opencv (Itseez/opencv)
opencv_contrib (Itseez/opencv_contrib)

D:\opencv_merge\opencv-master
D:\opencv_merge\opencv_contrib-master

2。下载并安装 CMake 最新版本(当前为 3.5.2)

3。 CMake 生成

(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

(3) 设置OPENCV_EXTRA_MODULES_PATH

D:/opencv_merge/opencv_contrib-master/modules

press 'Configure'
watch output double check again

(4) 生成

4。打开 OpenCV.sln

'Solution Explorer' CMakeTargets-->Install -->Right Click -->Build

5。获取 opencv-310.jar 和 opencv_java310.dll

(D:\opencv_merge\opencv-master\build\install\java)

6。 Netbeans 设置

(1) add Opencv Library (add opencv-310.jar to Library)
(2) VM options: -Djava.library.path=D:\opencv_merge\opencv-master\build\install\java

7.运行项目

8.写一些代码:

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);
}

9.运行项目并测试

ORB检测器可以执行(当然)

但是SIFT和SURF检测器不能

enter image description here


看到这个解决方案后,我做了一点修改:(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文件夹中找不到'opencv_java310.dll'(D:\opencv_merge\opencv-master\build\install\java)我尝试重复相同的步骤至少 5 次,但仍然没有“opencv_java310.dll”

原因似乎是我手动更改了'features2d_manual.hpp'

我已经出去一整天了:(

谁能帮我解决这个问题

谢谢大家

最佳答案

猜测你的问题是手动修改features2d_manual.hpp后需要重新编译。那对我有用。

您可以在中看到我的回答“SURF and SIFT algorithms doesn't work in OpenCV 3.0 Java

关于java - SURF 和 SIFT 算法在 Open CV 3.0 Java 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37506482/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com