Ask Your Question

Revision history [back]

drawKeypoints bug?

Hi! I'm trying to learn some Opencv with Python, and I'm following illustrations/examples from a book, and I'm stuck because of what seems to be a bug. It says " AttributeError: module 'cv2.cv2' has no attribute 'drawKeypoints' "

I'm using native Python 3.6.6 on windows 7, 64bit. I installed Opencv3 with pip. The OpenCv version I'm using is 4.0.0. The book I'm trying to learn from is called OpenCV 3x with Python By Example Second Edition. And it's written by Gabriel Garrido.

I've reinstalled OpenCv, without success...I also tried some suggestion about installing Opencv-contrib module (or something like that), and it didn't do any differences or whatsoever.

I've also attached a link with a picture of the code that gives me the error, so I hope the picture is available by the time this post is accepted by a mod! ^^

So is this a bug or something like that in OpenCv, or is cv2.drawKeypoints(input_image, keypoints, input_image, color=(0,255,0)) this just an incorrect use of the drawKeypoints function?

image description

drawKeypoints bug?

Hi! I'm trying to learn some Opencv with Python, and I'm following illustrations/examples from a book, and I'm stuck because of what seems to be a bug. It says " AttributeError: module 'cv2.cv2' has no attribute 'drawKeypoints' "

I'm using native Python 3.6.6 on windows 7, 64bit. I installed Opencv3 with pip. The OpenCv version I'm using is 4.0.0. The book I'm trying to learn from is called OpenCV 3x with Python By Example Second Edition. And it's written by Gabriel Garrido.

I've reinstalled OpenCv, without success...I also tried some suggestion about installing Opencv-contrib module (or something like that), and it didn't do any differences or whatsoever.

I've also attached a link with a picture of the code that gives me the error, so I hope the picture is available by the time this post is accepted by a mod! ^^

So is this a bug or something like that in OpenCv, or is cv2.drawKeypoints(input_image, keypoints, input_image, color=(0,255,0)) this just an incorrect use of the drawKeypoints function?

image description[Edit] So here's the result of print(cv2.getBuildInformation()) :

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

  Platform:
    Timestamp:                   2019-01-09T18:51:15Z
    Host:                        Windows 6.3.9600 AMD64
    CMake:                       3.12.2
    CMake generator:             Visual Studio 14 2015 Win64
    CMake build tool:            C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
    MSVC:                        1900

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (5 files):          + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (4 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (11 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

  C/C++:
    Built as dynamic libs?:      NO
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe  (ver 19.0.
24241.7)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D
 _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi      /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP2   /MT /O2 /Ob2 /
DNDEBUG
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D
 _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi      /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP2   /MTd /Zi /Ob0
/Od /RTC1
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SC
L_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP2    /MT /O2 /Ob2 /DNDEBUG
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SC
L_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP2  /MTd /Zi /Ob0 /Od /RTC1
    Linker flags (Release):      /machine:x64  /NODEFAULTLIB:atlthunk.lib /INCREMENTAL:NO  /NODEFAULTLIB:libcmtd.lib /NO
DEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:msvcrtd.lib
    Linker flags (Debug):        /machine:x64  /NODEFAULTLIB:atlthunk.lib /debug /INCREMENTAL  /NODEFAULTLIB:libcmt.lib
/NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:msvcrt.lib
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:          ade comctl32 gdi32 ole32 setupapi ws2_32
    3rdparty dependencies:       ittnotify libprotobuf zlib libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc
ippiw ippicv

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc java_bindings_generato
r ml objdetect photo python3 python_bindings_generator stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java js python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  Windows RT support:            NO

  GUI:
    Win32 UI:                    YES
    VTK support:                 NO

  Media I/O:
    ZLib:                        build (ver 1.2.11)
    JPEG:                        build-libjpeg-turbo (ver 1.5.3-62)
    WEBP:                        build (ver encoder: 0x020e)
    PNG:                         build (ver 1.6.35)
    TIFF:                        build (ver 42 - 4.0.9)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (ver 58.35.100)
      avformat:                  YES (ver 58.20.100)
      avutil:                    YES (ver 56.22.100)
      swscale:                   YES (ver 5.3.100)
      avresample:                YES (ver 4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2019.0.0 Gold [2019.0.0]
           at:                   C:/projects/opencv-python/_skbuild/win-amd64-3.6/cmake-build/3rdparty/ippicv/ippicv_win
/icv
    Intel IPP IW:                sources (2019.0.0)
              at:                C:/projects/opencv-python/_skbuild/win-amd64-3.6/cmake-build/3rdparty/ippicv/ippicv_win
/iw
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                C:/projects/opencv-python/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Python36-x64/python.exe (ver 3.6.6)
    Libraries:                   C:/Python36-x64/libs/python36.lib (ver 3.6.6)
    numpy:                       C:/Python36-x64/lib/site-packages/numpy/core/include (ver 1.11.3)
    packages path:               C:/Python36-x64/Lib/site-packages

  Python (for build):            C:/Python27-x64/python.exe

  Java:
    ant:                         NO
    JNI:                         C:/Program Files/Java/jdk1.8.0/include C:/Program Files/Java/jdk1.8.0/include/win32 C:/
Program Files/Java/jdk1.8.0/include
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    C:/projects/opencv-python/_skbuild/win-amd64-3.6/cmake-install
-----------------------------------------------------------------

And thanks again LBerger, for helping me with this, and also making me realize I didn't had to make a new comment all the time! :P