apt install cmake
apt install qt5-default python-dev python3-dev -y
cd /data/opencv-4.4.0/build
cmake ..
make -j32
make install
CMakeLists.txt:-
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/data/opencv-4.4.0/distribute \
-DINSTALL_C_EXAMPLES=ON \
-DOPENCV_GENERATE_PKGCONFIG=ON \
-DINSTALL_PYTHON_EXAMPLES=ON \
-DBUILD_SHARED_LIBS=ON \
-DWITH_TBB=ON \
-DWITH_V4L=ON \
-DBUILD_opencv_world=OFF \
-DOPENCV_PYTHON3_INSTALL_PATH=/data/opencv-4.4.0/distribute/python3 \
-DWITH_QT=ON \
-DWITH_OPENGL=ON \
-DWITH_FFMPEG=ON \
-DHAVE_FFMPEG=OFF \
-DWITH_CUDA=ON \
-DHAVE_CUDNN=ON \
-DCUDNN_INCLUDE_DIRS=/data/cuda/include \
-DCUDNN_LIBRARY=/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.4 \
-DWITH_CUFFT=ON \
-DWITH_CUBLAS=ON \
-DWITH_NVCUVID=OFF \
-DHAVE_NVCUVID=OFF\
-DWITH_NVCUVENC=ON \
-DHAVE_NVCUVENC=ON \
-DBUILD_CUDA_STUBS=ON \
-DBUILD_opencv_cudalegacy=ON \
-DBUILD_opencv_cudacodec=ON \
-DCUDA_FAST_MATH=ON \
-DCUDA_ARCH_BIN="8.6" \
-DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-11.1" \
-DOPENCV_EXTRA_MODULES_PATH="/data/opencv_contrib-4.4.0/modules" \
-DBUILD_NEW_PYTHON_SUPPORT=ON \
-DBUILD_opencv_python3=ON \
-DHAVE_opencv_python3=ON \
-DPYTHON3_EXECUTABLE=/usr/bin/python3 \
-DPYTHON3_DEFAULT_EXECUTABLE=/usr/bin/python3 \
-DPYTHON3_INCLUDE_PATH=/usr/include/python3.6 \
-DPYTHON3_NUMPY_INCLUDE_DIRS=/usr/lib/x86_64-linux-gnu/python3.6/site-packages/numpy/core/include \
-DPYTHON3_PACKAGES_PATH=/usr/lib/x86_64-linux-gnu/python3.6/site-packages \
-DPYTHON3_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.6.so \
-DPYTHON3_LIBRARIES_PATH=/usr/lib/x86_64-linux-gnu \
-D OpenGL_GL_PREFERENCE=GLVND \
-D BUILD_opencv_rgbd=OFF \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_GTK_2_X=ON \
-DBUILD_EXAMPLES=OFF ..