docker pull ubuntu:20.04
docker run -it ubuntu:20.04 /bin/bash
apt update
apt -y install wget vim unzip cmake build-essential
apt -y install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
apt -y install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev
apt -y install libgtk-3-dev libfreeimage3 libfreeimage-dev
apt -y install libpng-dev libjpeg-dev libopenexr-dev libtiff-dev libwebp-dev libdc1394-dev
apt -y install pkg-config libfreetype-dev libharfbuzz-dev

mkdir -p /home/hesy/opencv && cd /home/hesy/opencv
wget https://github.com/opencv/opencv/archive/refs/tags/4.9.0.tar.gz
wget https://github.com/opencv/opencv_contrib/archive/refs/tags/4.9.0.zip
unzip opencv_contrib-4.9.0.zip
tar xvf opencv-4.9.0.tar.gz
cd opencv-4.9.0
mkdir build && cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_IPP=OFF -D WITH_OPENGL=OFF -D WITH_QT=OFF -D OPENCV_ENABLE_NONFREE=ON -D OPENCV_EXTRA_MODULES_PATH=/home/hesy/opencv/opencv_contrib-4.9.0/modules -D BUILD_EXAMPLES=OFF -D WITH_JASPER=OFF -D BUILD_DOCS=OFF -D BUILD_TESTS=OFF -D BUILD_opencv_java=NO -D BUILD_opencv_python=NO -D BUILD_opencv_python2=NO -D BUILD_opencv_python3=NO -DWITH_FREETYPE=ON ..

make -j32
make install

tar czvf opencv-dev-4.9.0.tar.gz /usr/local/include usr/local/lib

本文链接地址:https://const.net.cn/794.html

标签: none

添加新评论