Ubuntu18.04-安装opencv3.2.0_contrib

在opencv安装包文件夹下,下载opencv3.2.0_contrib包

wget https://github.com/opencv/opencv_contrib/archive/3.2.0.zip

解压命名为opencv_contrib-3.2.0
Ubuntu18.04-安装opencv3.2.0_contrib_第1张图片

sudo apt-get install build-essential 
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.2.0/modules .. -DENABLE_PRECOMPILED_HEADERS=OFF - D BUILD_EXAMPLES=ON -D CMAKE_CXX_FLAGS="-std=c++11" ..

编译

sudo make -j12

出现问题1:
在这里插入图片描述找到opencv-3.2.0/build/opencv_lapack.h
将第二行中的#include"LAPACKE_H_PATH-NOTFOUND/lapacke.h" 修改为#include"lapacke.h"即可

出现问题2:
opencv-3.3.0/modules/videoio/src/cap_ffmpeg_impl.hpp文件,在文件开头加上

#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
#define AVFMT_RAWPICTURE 0x0020

https://blog.csdn.net/Dead_Rabbit6_0/article/details/78044754
https://www.jianshu.com/p/da49a712410f
https://www.cnblogs.com/didada/p/12305066.html

https://www.cnblogs.com/didada/p/12305066.html
https://blog.csdn.net/weixin_43310122/article/details/109340955

你可能感兴趣的:(opencv,计算机视觉)