赞
踩
sudo apt update
sudo apt-get install build-essential cmake git
sudo apt-get install pkg-config libavcodec-dev libavformat-dev libswscale-dev libatlas-base-dev gfortran zlib1g-dev ccache
#这些可先不安装,后面看是否会报错
sudo apt-get install autoconf automake libtool checkinstall
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
sudo apt-get install libjpeg-dev libjpeg8-dev libtiff5-dev libjasper-dev libpng-dev
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
修改opencv_contrib下面的modules/xfeatures2d/cmake/download_boostdesc.cmake文件,将下载地址https://raw.githubusercontent.com/opencv/opencv_3rdparty/ 修改为:
https://ghproxy.com//https://raw.githubusercontent.com/opencv/opencv_3rdparty/
vgg文件下载错误同理(即在原地址前加上https://ghproxy.com//)。
1、No package ‘libavresample’ found:
sudo apt-get -y install libavresample-dev
2、error:No package ‘libgphoto2’ found:
sudo apt-get -y install libgphoto2-dev
3、No package ‘gtk±3.0’ found,No package ‘gtk±2.0’ found:
sudo apt-get install libgtk-3-dev
apt-get install libgtk2.0-dev
4、-- Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
– Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
– Could NOT find Atlas (missing: Atlas_CBLAS_INCLUDE_DIR Atlas_CLAPACK_INCLUDE_DIR Atlas_CBLAS_LIBRARY Atlas_BLAS_LIBRARY Atlas_LAPACK_LIBRARY)
– Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
– Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
– Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
– VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file:
apt安装的openblas似乎不行,只能自己下载源码编译,很简单,只需要注意提前安装fortran编译器
sudo apt-get install gfortran
然后去https://github.com/xianyi/OpenBLAS下载下来源码编译安装,但我操作完之后还是有版本问题。
sudo apt install doxygen openjdk-8-jdk libvtk7-dev
5、Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version “2.7”):
cmake编译命令加上新参数不编译python包,不然编译阶段很可能会报错(也可以忽略这个警告,加上参数更保险):
cmake -DBUILD_opencv_python3=OFF DBUILD_opencv_python2=OFF -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
6、Looking for linux/videodev.h - not found:
忽略
7、Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
sudo apt install libhdf5-dev
8、Failed to find gflags:
sudo apt-get install libgflags-dev
9、Failed to find glog:
sudo apt-get install libgoogle-glog-dev
10、The imported target “vtk” references the file “/usr/bin/vtk” but this file does not exist:
sudo ln -s /usr/bin/vtk7 /usr/bin/vtk
11、No package ‘tesseract’ found:
cd ~
git clone https://ghproxy.com//https://github.com/tesseract-ocr/tesseract.git
cd tesseract
./autogen.sh
./configure
make -j4
sudo make install
sudo ldconfig
若报错:CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Tesseract_INCLUDE_DIR
则删除build文件夹下的所有东西重新编译
12、No package ‘gstreamer-base-1.0’ found:
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
13、No package ‘libdc1394-2’ found:
sudo apt-get install libdc1394-22-dev
14、最后还是剩下了一些问题没有解决,忽略:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。