Open4

Build the Wheel installer for opencv-contrib-python

PINTOPINTO

raspberrypi, ubuntu/debian

$ git clone -b 52 --recursive https://github.com/opencv/opencv-python.git \
  && cd opencv-python

$ sudo pip3 install scikit-build
$ export ENABLE_CONTRIB=1
$ sudo python3 setup.py bdist_wheel
PINTOPINTO

jetson L4T build

$ sudo apt-get install -y \
build-essential cmake git unzip pkg-config \
libjpeg-dev libpng-dev libgtk2.0-dev \
python3-dev python3-numpy python3-pip \
libxvidcore-dev libx264-dev libssl-dev \
libtbb2 libtbb-dev libdc1394-22-dev \
gstreamer1.0-tools libv4l-dev v4l-utils \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libvorbis-dev libxine2-dev \
libfaac-dev libmp3lame-dev libtheora-dev \
libopencore-amrnb-dev libopencore-amrwb-dev \
libopenblas-dev libatlas-base-dev libblas-dev \
liblapack-dev libeigen3-dev \
libhdf5-dev protobuf-compiler \
libprotobuf-dev libgoogle-glog-dev libgflags-dev \
libavutil55=7:3.4.2-2 libavutil-dev libavcodec-dev \
libavformat-dev libswscale-dev ffmpeg

$ git clone -b 54 --recursive https://github.com/opencv/opencv-python.git \
  && cd opencv-python

$ sudo pip3 install scikit-build
$ sudo apt remove --purge cmake
$ sudo pip3 install cmake --upgrade
$ hash -r
$ export ENABLE_CONTRIB=1
####$ export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DEIGEN_INCLUDE_PATH=/usr/include/eigen3 -DWITH_OPENCL=OFF -DWITH_CUDA=ON -DCUDA_ARCH_BIN=5.3 -DCUDA_ARCH_PTX="" -DWITH_CUDNN=ON -DCUDNN_VERSION=8.0 -DWITH_CUBLAS=ON -DENABLE_FAST_MATH=ON -DCUDA_FAST_MATH=ON -DOPENCV_DNN_CUDA=ON -DENABLE_NEON=ON -DWITH_QT=OFF -DWITH_OPENMP=ON -DWITH_OPENGL=ON -DBUILD_TIFF=ON -DWITH_FFMPEG=ON -DWITH_GSTREAMER=ON -DWITH_TBB=ON -DBUILD_TBB=ON -DBUILD_TESTS=OFF -DWITH_EIGEN=ON -DWITH_V4L=ON -DWITH_LIBV4L=ON -DOPENCV_ENABLE_NONFREE=OFF -DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_opencv_python3=TRUE -DOPENCV_GENERATE_PKGCONFIG=ON -DBUILD_EXAMPLES=OFF"
####$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
####$ sudo ldconfig
$ sudo python3 setup.py bdist_wheel
PINTOPINTO

jetson cmake

-- General configuration for OpenCV 4.5.2 =====================================
--   Version control:               4.5.2
-- 
--   Platform:
--     Timestamp:                   2021-06-08T09:19:51Z
--     Host:                        Linux 4.9.201-tegra aarch64
--     CMake:                       3.20.2
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make
--     Configuration:               Release
-- 
--   CPU/HW features:
--     Baseline:                    NEON FP16
-- 
--   C/C++:
--     Built as dynamic libs?:      NO
--     C++ standard:                11
--     C++ Compiler:                /usr/bin/c++  (ver 7.5.0)
--     C++ flags (Release):         -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
--     C++ flags (Debug):           -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
--     C Compiler:                  /usr/bin/cc
--     C flags (Release):           -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
--     C flags (Debug):             -fsigned-char -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections    -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
--     Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed  
--     Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed  
--     ccache:                      NO
--     Precompiled headers:         NO
--     Extra dependencies:          /usr/lib/aarch64-linux-gnu/libgtk-x11-2.0.so /usr/lib/aarch64-linux-gnu/libgdk-x11-2.0.so /usr/lib/aarch64-linux-gnu/libpangocairo-1.0.so /usr/lib/aarch64-linux-gnu/libatk-1.0.so /usr/lib/aarch64-linux-gnu/libcairo.so /usr/lib/aarch64-linux-gnu/libgdk_pixbuf-2.0.so /usr/lib/aarch64-linux-gnu/libgio-2.0.so /usr/lib/aarch64-linux-gnu/libpangoft2-1.0.so /usr/lib/aarch64-linux-gnu/libpango-1.0.so /usr/lib/aarch64-linux-gnu/libgobject-2.0.so /usr/lib/aarch64-linux-gnu/libglib-2.0.so /usr/lib/aarch64-linux-gnu/libfontconfig.so /usr/lib/aarch64-linux-gnu/libfreetype.so /usr/lib/aarch64-linux-gnu/libgthread-2.0.so /usr/lib/aarch64-linux-gnu/libjpeg.so /usr/lib/aarch64-linux-gnu/libpng.so /usr/lib/aarch64-linux-gnu/libz.so dl m pthread rt
--     3rdparty dependencies:       ittnotify libprotobuf ade libwebp libtiff libopenjp2 IlmImf quirc tegra_hal
-- 
--   OpenCV modules:
--     To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
--     Disabled:                    world
--     Disabled by dependency:      -
--     Unavailable:                 java python2 ts
--     Applications:                -
--     Documentation:               NO
--     Non-free algorithms:         NO
-- 
--   GUI: 
--     GTK+:                        YES (ver 2.24.32)
--       GThread :                  YES (ver 2.56.4)
--       GtkGlExt:                  NO
--     VTK support:                 NO
-- 
--   Media I/O: 
--     ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
--     JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
--     WEBP:                        build (ver encoder: 0x020f)
--     PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.34)
--     TIFF:                        build (ver 42 - 4.2.0)
--     JPEG 2000:                   build (ver 2.4.0)
--     OpenEXR:                     build (ver 2.3.0)
--     HDR:                         YES
--     SUNRASTER:                   YES
--     PXM:                         YES
--     PFM:                         YES
-- 
--   Video I/O:
--     DC1394:                      YES (2.2.5)
--     FFMPEG:                      YES
--       avcodec:                   YES (57.107.100)
--       avformat:                  YES (57.83.100)
--       avutil:                    YES (55.78.100)
--       swscale:                   YES (4.8.100)
--       avresample:                NO
--     GStreamer:                   YES (1.14.5)
--     v4l/v4l2:                    YES (linux/videodev2.h)
-- 
--   Parallel framework:            pthreads
-- 
--   Trace:                         YES (with Intel ITT)
-- 
--   Other third-party libraries:
--     Lapack:                      NO
--     Eigen:                       YES (ver 3.3.4)
--     Custom HAL:                  YES (carotene (ver 0.0.1))
--     Protobuf:                    build (3.5.1)
-- 
--   OpenCL:                        YES (no extra features)
--     Include path:                /home/user/opencv-python/opencv/3rdparty/include/opencl/1.2
--     Link libraries:              Dynamic load
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3 (ver 3.6.9)
--     Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.6m.so (ver 3.6.9)
--     numpy:                       /usr/local/lib/python3.6/dist-packages/numpy/core/include (ver 1.19.4)
--     install path:                python
-- 
--   Python (for build):            /usr/bin/python2.7
-- 
--   Java:                          
--     ant:                         NO
--     JNI:                         NO
--     Java wrappers:               NO
--     Java tests:                  NO
-- 
--   Install to:                    /home/user/opencv-python/_skbuild/linux-aarch64-3.6/cmake-install
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/opencv-python/_skbuild/linux-aarch64-3.6/cmake-build