What is OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.
Install the required dependencies
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
Clone the OpenCV’s and OpenCV contrib repositories
mkdir ~/opencv_build && cd ~/opencv_build
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
Once the download is complete, create a temporary build directory, and switch to it
cd ~/opencv_build/opencvmkdir build && cd build
Set up the OpenCV build with CMake
cmake -D CMAKE_BUILD_TYPE=RELEASE \-D CMAKE_INSTALL_PREFIX=/usr/local \-D INSTALL_C_EXAMPLES=ON \-D INSTALL_PYTHON_EXAMPLES=ON \-D OPENCV_GENERATE_PKGCONFIG=ON \-D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \-D BUILD_EXAMPLES=ON ..
Start the compilation process
make -j8
Install OpenCV
make install
pkg-config --modversion opencv4





No comments:
Post a Comment