ubuntu18.04安装opencv3.4.3遇到问题解决方法

opencv-3.4.2 安装 (ubuntu 18.04)

问题1:

E: Unable to locate package libjasper-dev

解决方法:

https://blog.csdn.net/weixin_41053564/article/details/81254410

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"

sudo apt update

sudo apt install libjasper1 libjasper-dev

成功的解决了问题,其中libjasper1是libjasper-dev的依赖包

问题2:

No package 'gstreamer-base-1.0' found

解决方法:

https://stackoverflow.com/questions/37678324/compiling-opencv-with-gstreamer-cmake-not-finding-gstreamer

sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

问题3:

No package 'libavresample' found

解决方法:

sudo apt-get install libavresample-dev

问题4:

No package 'libgphoto2' found

解决方法:

sudo apt-get install libgphoto2-dev

问题5:

IPPICV: Download failed: 7;"Couldn't connect to server"

解决方法:

问题6:

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)

-- A library with BLAS API not found. Please specify library location.

-- LAPACK requires BLAS

-- A library with LAPACK API not found. Please specify library location.

-- 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

CMake Error at cmake/OpenCVModule.cmake:288 (message):

No modules has been found:

/home/program/opencv-3.4.2/opencv_contrib-3.4.0/modules

Call Stack (most recent call first):

cmake/OpenCVModule.cmake:368 (_glob_locations)

modules/CMakeLists.txt:7 (ocv_glob_modules)

解决方法:

sudo apt-get install libopenblas-dev

问题7:

fatal error: linux/videodev.h: No such file or directory

fatal error: sys/videoio.h: No such file or directory

解决方法:

sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.

sudo cp /usr/include/opencv2/videoio/videoio_c.h /usr/include/x86_64-linux-gnu/sys

sudo ln -s /usr/include/x86_64-linux-gnu/sys/videoio_c.h /usr/include/x86_64-linux-gnu/sys/videoio.h

/usr/include/目录下创建sys目录,然后touch文件 videoio.h

如果仍然没有成功,那么找到含有"videodev.h"和"videoio.h"头文件的源文件,

将#include <> 改为#include ""