Actions
Building OpenCV¶
Prerequisites¶
- Install CUDA: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/
- Install cuDNN:
- Install OpenCV prereqs:
$ sudo apt install build-essential cmake git pkg-config libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev python3-dev python3-numpy libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libvtk7-dev libdc1394-dev
Build from source¶
- From a working directory clone the contrib repository:
- Download OpenCV release (currently 4.7.0) to working directory and untar:
- Create build directory and enter it:
- Configure build (NOTE: this will set the install directory to
/opt/local, change as needed): - Build (this will take a while) then install:
Miscellaneous¶
- To use the OpenCV Python bindings you need to set the
PYTHONPATHto include the install directory under/opt/local:
Updated by over 3 years ago · 1 revisions