Ubuntu OpenCV无法编译 [英] Ubuntu OpenCV not compiling

查看:211
本文介绍了Ubuntu OpenCV无法编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下命令使用贡献来编译OpenCV 3.2:

I'm trying to compile OpenCV 3.2 with contributions with the following commands:

1.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/ -DOPENCV_EXTRA_MODULES_PATH=/home/matteo/Desktop/Xilinx/OpenCV/source/opencv_contrib/modules/ /home/matteo/Desktop/Xilinx/OpenCV/source/opencv-3.2.0/
2.
make -j7 # runs 7 jobs in parallel
3.
sudo make install

您能解释一下我为什么得到

Can you explain why I get

...
........
...........
........................
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Caffe:   NO
-- Protobuf:   NO
-- Glog:   NO
-- Downloading ...
CMake Error at cmake/OpenCVUtils.cmake:1043 (file):
  file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
  ../opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
  ../opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)


CMake Error at cmake/OpenCVUtils.cmake:1047 (message):
  Failed to download .  Status=
Call Stack (most recent call first):
  ../opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
  ../opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)


-- Configuring incomplete, errors occurred!

我正在使用Ubuntu 16.04.我已经在系统上安装了OpenCV:也许我以错误的方式取消了安装?我记得用上面使用的相同命令来编译OpenCV 3.2.

I'm working with Ubuntu 16.04 . I already had OpenCV on the system: maybe I unistall it in the wrong way? I remember to compile OpenCV 3.2 with the same command used above.

推荐答案

您必须具有opencv_contrib和opencv本身的匹配版本.

在opencv github下,转到 OpenCV版本并下载3.2.0(应该与master分支中的相同).

Under the opencv github, go to the OpenCV releases and download the 3.2.0 (it should be the same in the master branch).

现在,转到 https://github.com/opencv/opencv_contrib/releases 并下载3.2.0.然后,您将使两个版本都匹配.

Now, go to https://github.com/opencv/opencv_contrib/releases and download the 3.2.0. Then you will have both versions matching.

之后,在opencv_contrib master分支的README.md上找到的所有cmake命令都应该可以正常工作.

After that all the cmake commands found on the README.md at opencv_contrib master branch should work fine.

这篇关于Ubuntu OpenCV无法编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆