OpenCV 3.4.4

→Liste de commandes SHELL à lancer automatiquement sous /home/ms pour installer OpenCV 3.4.4 :

$ chmod +x install_opencv.sh
$ ./install_opencv.sh

La suite s’exécute automatiquement en moins de 30 minutes :


1. KEEP UBUNTU & LINUX MINT UP TO DATE

sudo apt -y update
sudo apt -y upgrade
sudo apt -y dist-upgrade
sudo apt -y autoremove


2. INSTALL THE DEPENDENCIES

# Build tools:
sudo apt install -y build-essential cmake

# GUI:
sudo apt install -y libgtk2.0-dev

# Media I/O:
sudo apt install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev

# Video I/O:
sudo apt install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev

# Signal
sudo apt install -y libfftw3-dev

# ImageMagick
sudo apt install -y imagemagick

# Python 2 & 3:
sudo apt install -y python-dev python-numpy python-scipy python-pip
sudo apt install -y python3-dev python3-numpy python3-scipy python3-pip

# Java:
sudo apt install -y ant default-jdk

# Documentation:
sudo apt install -y doxygen


3. INSTALL THE LIBRARY (YOU CAN CHANGE ‘3.4.4’ FOR THE LAST STABLE VERSION)

sudo apt install -y unzip wget
wget https://github.com/opencv/opencv/archive/3.4.4.zip
unzip 3.4.4.zip
rm 3.4.4.zip
mv opencv-3.4.4 opencv
wget https://github.com/opencv/opencv_contrib/archive/3.4.4.zip
unzip 3.4.4.zip
rm 3.4.4.zip
mv opencv_contrib-3.4.4 opencv_contrib
cd opencv
mkdir build
cd build
# CUDA_GENERATION=Fermi|Kepler|Pascal|Volta
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DCUDA_GENERATION=Pascal -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -DOPENCV_ENABLE_NONFREE=ON -DBUILD_EXAMPLES=ON ..

make -j4
sudo make install
sudo ldconfig

image_pdfimage_print