tech:compilation_opencv_sur_debian
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:compilation_opencv_sur_debian [2025/05/20 17:49] – Jean-Baptiste | tech:compilation_opencv_sur_debian [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Compilation OpenCV sur Debian | ||
| + | |||
| + | Voir aussi : | ||
| + | * **skimage** est une alternative à **OpenCV** | ||
| + | * YOLO (Python) | ||
| + | |||
| + | Compilation et installation d' | ||
| + | |||
| + | Prérequis | ||
| + | ~~~bash | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install -y build-essential | ||
| + | sudo apt-get install -y cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev | ||
| + | sudo apt-get install -y python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev | ||
| + | sudo apt-get -y install unzip | ||
| + | |||
| + | # Pour la création du .deb | ||
| + | sudo apt-get install -y fakeroot checkinstall | ||
| + | ~~~ | ||
| + | |||
| + | Téléchargement des sources | ||
| + | ~~~bash | ||
| + | mkdir ~/src | ||
| + | cd ~/src | ||
| + | wget https:// | ||
| + | unzip 3.3.0.zip | ||
| + | ~~~ | ||
| + | |||
| + | Pas nécessaire si `-DWITH_IPP=OFF` on option de compilation | ||
| + | ~~~bash | ||
| + | mkdir -p ~/ | ||
| + | cd !$ | ||
| + | export https_proxy=http:// | ||
| + | wget https:// | ||
| + | ~~~ | ||
| + | |||
| + | Compilation | ||
| + | ~~~bash | ||
| + | cd ~/ | ||
| + | #cmake -DWITH_CUDA=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DENABLE_PRECOMPILED_HEADERS=OFF .. | ||
| + | |||
| + | #cmake -DCMAKE_INSTALL_PREFIX=/ | ||
| + | |||
| + | cmake -DBUILD_TIFF=ON \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | .. | ||
| + | |||
| + | make -j $(nproc) | ||
| + | ~~~ | ||
| + | |||
| + | Installation | ||
| + | ~~~bash | ||
| + | sudo make install | ||
| + | ~~~ | ||
| + | |||
| + | ## Création d'un paquet Debian avec checkinstall | ||
| + | |||
| + | ~~~bash | ||
| + | cat > | ||
| + | libopencv | ||
| + | This package contains the header files and static library needed to compile | ||
| + | applications that use OpenCV (Open Computer Vision) core. | ||
| + | . | ||
| + | The Open Computer Vision Library is a collection of algorithms and sample | ||
| + | code for various computer vision problems. The library is compatible with | ||
| + | IPL (Intel' | ||
| + | (Intel' | ||
| + | . | ||
| + | OpenCV provides low level portable data types and operators, and a set | ||
| + | of high level functionalities for video acquisition, | ||
| + | analysis, structural analysis, motion analysis and object tracking, object | ||
| + | recognition, | ||
| + | EOF | ||
| + | |||
| + | echo | fakeroot checkinstall --install=no \ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | | ||
| + | ~~~ | ||
| + | |||
| + | TODO : ldconfig | ||
| + | |||
| + | Exemple | ||
| + | `DEBIAN/ | ||
| + | ~~~ | ||
| + | libcudnn 7 libcudnn7 | ||
| + | ~~~ | ||
| + | |||
| + | Voir http:// | ||
| + | |||
| + | `DEBIAN/ | ||
| + | ~~~ | ||
| + | # Triggers added by dh_makeshlibs/ | ||
| + | activate-noawait ldconfig | ||
| + | ~~~ | ||
| + | Voir : https:// | ||
| + | |||
