OpenCV 3.4.3

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

$ chmod +x install_opencv.sh
$ install_opencv.sh

La suite s’exécute automatiquement en 1h environ :


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

# Python:
sudo apt install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpy

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

# Documentation:
sudo apt install -y doxygen


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

sudo apt install -y unzip wget
wget https://github.com/opencv/opencv/archive/3.4.3.zip
unzip 3.4.3.zip
rm 3.4.3.zip
mv opencv-3.4.3 opencv
wget https://github.com/opencv/opencv_contrib/archive/3.4.3.zip
unzip 3.4.3.zip
rm 3.4.3.zip
mv opencv_contrib-3.4.3 opencv_contrib
cd opencv
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_CUDA=ON -DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules -DBUILD_EXAMPLES=ON ..
make -j4
sudo make install
sudo ldconfig