Ask Your Question

Revision history [back]

GPU matcher on Python

Hello, i have compiled OpenCV for Python with cudafeatures2d installed. Unfortunately, i could find any succinct documentation on cuda module in general and on cudafeatures2d with Python.

My final task is to use gpu-based matcher for AKAZE descriptors (in Python). I haven't been able to google any reasonable answer to how to do it with OpenCV without manual software carpentry. Please advice how to do it.

Here's output of getBuildInformation():

General configuration for OpenCV 3.3.1 =====================================
Version control:               3.3.1

Extra modules:
  Location (extra):            /opt/opencv/opencv_contrib/modules
  Version control (extra):     3.3.1

Platform:
  Timestamp:                   2018-11-23T15:10:05Z
  Host:                        Linux 4.4.0-98-generic x86_64
  CMake:                       3.5.1
  CMake generator:             Unix Makefiles
  CMake build tool:            /usr/bin/make
  Configuration:               RELEASE

CPU/HW features:
  Baseline:                    SSE SSE2 SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX
    requested:                 SSE3
    required:                  AVX
  Dispatched code generation:  FP16 AVX2
    requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2
    FP16 (1 files):            + FP16
    AVX2 (8 files):            + FP16 FMA3 AVX2

C/C++:
  Built as dynamic libs?:      YES
  C++ Compiler:                /usr/bin/c++  (ver 5.4.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 -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -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 -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -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=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -fvisibility=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 -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffast-math -ffunction-sections  -msse -msse2 -msse3 -mssse3 -msse4.1 -mpopcnt -msse4.2 -mavx -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
  Linker flags (Release):
  Linker flags (Debug):
  ccache:                      NO
  Precompiled headers:         YES
  Extra dependencies:          dl m pthread rt cudart nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/local/cuda/lib64
  3rdparty dependencies:

OpenCV modules:
  To be built:                 cudev core cudaarithm flann hdf imgproc ml objdetect phase_unwrapping plot reg surface_matching video xphoto bgsegm cudabgsegm cudafilters cudaimgproc cudawarping dnn face fuzzy img_hash imgcodecs photo shape videoio xobjdetect cudacodec highgui bioinspired dpm features2d line_descriptor saliency text calib3d ccalib cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo datasets rgbd stereo structured_light superres tracking videostab xfeatures2d ximgproc aruco optflow stitching python2
  Disabled:                    js world contrib_world
  Disabled by dependency:      -
  Unavailable:                 java python3 ts viz cnn_3dobj cvv dnn_modern freetype matlab sfm

GUI: 
  QT:                          NO
  GTK+:                        NO
  GThread :                    NO
  GtkGlExt:                    NO
  OpenGL support:              NO
  VTK support:                 NO

Media I/O: 
  ZLib:                        /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.8)
  JPEG:                        /usr/lib/x86_64-linux-gnu/libjpeg.so (ver )
  WEBP:                        build (ver encoder: 0x020e)
  PNG:                         /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.54)
  TIFF:                        build (ver 42 - 4.0.2)
  JPEG 2000:                   build (ver 1.900.1)
  OpenEXR:                     build (ver 1.7.1)
  GDAL:                        NO
  GDCM:                        NO

Video I/O:
  DC1394 1.x:                  NO
  DC1394 2.x:                  NO
  FFMPEG:                      NO
    avcodec:                   NO
    avformat:                  NO
    avutil:                    NO
    swscale:                   NO
    avresample:                NO
  GStreamer:                   NO
  OpenNI:                      NO
  OpenNI PrimeSensor Modules:  NO
  OpenNI2:                     NO
  PvAPI:                       NO
  GigEVisionSDK:               NO
  Aravis SDK:                  NO
  UniCap:                      NO
  UniCap ucil:                 NO
  V4L/V4L2:                    NO/NO
  XIMEA:                       NO
  Xine:                        NO
  Intel Media SDK:             NO
  gPhoto2:                     NO

Parallel framework:            pthreads

Trace:                         YES (with Intel ITT)

Other third-party libraries:
  Use Intel IPP:               2017.0.3 [2017.0.3]
             at:               /opt/opencv/build/3rdparty/ippicv/ippicv_lnx
  Use Intel IPP IW:            sources (2017.0.3)
                at:            /opt/opencv/build/3rdparty/ippicv/ippiw_lnx
  Use VA:                      NO
  Use Intel VA-API/OpenCL:     NO
  Use Lapack:                  NO
  Use Eigen:                   NO
  Use Cuda:                    YES (ver 8.0)
  Use OpenCL:                  YES
  Use OpenVX:                  NO
  Use custom HAL:              NO

NVIDIA CUDA
  Use CUFFT:                   YES
  Use CUBLAS:                  YES
  USE NVCUVID:                 NO
  NVIDIA GPU arch:             61
  NVIDIA PTX archs:
  Use fast math:               YES

OpenCL:                        <Dynamic loading of OpenCL library>
  Include path:                /opt/opencv/opencv/3rdparty/include/opencl/1.2
  Use AMDFFT:                  NO
  Use AMDBLAS:                 NO

Python 2:
  Interpreter:                 /usr/bin/python2.7 (ver 2.7.12)
  Libraries:                   /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.12)
  numpy:                       /usr/local/lib/python2.7/dist-packages/numpy/core/include (ver 1.13.3)
  packages path:               lib/python2.7/dist-packages

Python 3:
  Interpreter:                 /usr/bin/python3 (ver 3.5.2)

Python (for build):            /usr/bin/python2.7

Java:
  ant:                         NO
  JNI:                         NO
  Java wrappers:               NO
  Java tests:                  NO

Matlab:                        Matlab not found or implicitly disabled

Documentation:
  Doxygen:                     NO

Tests and samples:
  Tests:                       NO
  Performance tests:           NO
  C/C++ Examples:              NO

Install path:                  /usr/local

cvconfig.h is in:              /opt/opencv/build