gpt4 book ai didi

java - OpenCV 3.0.0 JAR 中缺少 HighGUI

转载 作者:IT老高 更新时间:2023-10-28 12:33:55 33 4
gpt4 key购买 nike

我正在编译支持 Java 的 OpenCV 3.0.0。我的脚本是:

mkdir /opt/opencv /opt/opencv/opencv-build
cd /opt/opencv
git clone https://github.com/Itseez/opencv.git
cd /opt/opencv/opencv-build
export OPENCV_INSTALL_PATH=/opt/opencv
export FFMPEG_PATH=/opt/ffmpeg/ffmpeg_build/lib
export LD_LIBRARY_PATH=$OPENCV_INSTALL_PATH/lib:$FFMPEG_PATH:/opt/opencv/opencv/3rdparty/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/opt/ffmpeg/ffmpeg_build/lib/pkgconfig
cmake28 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX="/opt/opencv" \
-D OPENCV_EXTRA_C_FLAGS="-DHAVE_CAMV4L -DHAVE_CAMV4L2" \
-D WITH_OPENCL=OFF -D BUILD_SHARED_LIBS=OFF ../opencv
make
make install

http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html 中所述使用 -D BUILD_SHARED_LIBS=OFF

当我想测试安装时,我发现没有 Highgui 类,也没有它的路径。这是我的 opencv-300.jar org.opencv 文件夹内容:

calib3d
core
features2d
imgcodecs
imgproc
ml
objdetect
photo
utils
video
videoio

我在安装过程中遗漏了什么吗?

最佳答案

从 OpenCV 2.x 迁移到 3.0.0 (Java)

Highgui.imread(fileName, Highgui.CV_LOAD_IMAGE_GRAYSCALE)
Highgui.imread(fileName)

成为响应:

Imgcodecs.imread(fileName, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE)
Imgcodecs.imread(fileName)

还有,绘图功能如:

Core.circle(..), Core.line(..), etc..

已移至:

Imgproc.circle(..), Imgproc.line(..)

注意Moments,HuMoments 在 3.0.0 中丢失。将在 3.1 中修复见 bug

关于java - OpenCV 3.0.0 JAR 中缺少 HighGUI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25059576/

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