Installing OpenCV
Procedure
- Use PuTTY to log in to the server as the root user.
- Download the installation package.
cd /path/to/opencv wget https://github.com/opencv/opencv/archive/refs/tags/4.5.5.tar.gz -O opencv-4.4.5.tar.gz
- Decompress the installation package and go to the directory generated after the decompression.
tar xvf opencv-4.4.5.tar.gz cd opencv-4.4.5
- Create a build directory.
mkdir build cd build
- Perform the compilation.
cmake .. -DCMAKE_INSTALL_PREFIX=/path/to/opencv make -j make install
- Load the environment variables.
export PATH=/path/to/opencv/bin:$PATH export LD_LIBRARY_PATH=/path/to/opencv/lib64:$LD_LIBRARY_PATH
Parent topic: Configuring the Compilation Environment