Ask Your Question

OpenCV 4.0.1 Cmake Windows does not configure correctly

asked 2019-02-19 05:43:36 -0500

tilman151 gravatar image

I am trying to build OpenCV on Win10 with VC15 x64 and Python 3.6 bindings. Python resides in an Anaconda env with Anaconda using Python 3.7 as a base. This in my output:

General configuration for OpenCV 4.0.1-dev =====================================
  Version control:               4.0.1-204-gabfcb6011

    Timestamp:                   2019-02-18T17:02:08Z
    Host:                        Windows 10.0.14393 AMD64
    CMake:                       3.9.0-rc4
    CMake generator:             Visual Studio 15 2017 Win64
    CMake build tool:            C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools/MSBuild/15.0/Bin/MSBuild.exe
    MSVC:                        1916

  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 (6 files):          + SSSE3 SSE4_1
      SSE4_2 (2 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (5 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (14 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe  (ver 19.16.27027.1)
    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 /MP4   /MD /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 /MP4   /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP4    /MD /O2 /Ob2 /DNDEBUG 
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi        /MP4  /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /INCREMENTAL:NO 
    Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL 
    ccache:                      NO
    Precompiled headers:         YES
    Extra dependencies:
    3rdparty dependencies:

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

  Windows RT support:            NO

    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:                      NO
      avcodec:                   NO
      avformat:                  NO
      avutil:                    NO
      swscale:                   NO
      avresample:                NO
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.5.1)

  OpenCL:                        YES (no extra features)
    Include path:                D:/Development/opencv/opencv/3rdparty/include/opencl ...
edit retag flag offensive close merge delete


Hallo Tilman, have you tried installing it through pip? i have it like that on my environment -> pip install opencv-python or if you need contrib modules -> pip install opencv-contrib-python and i can succesfully import the module saludos!

aguila gravatar imageaguila ( 2019-03-12 02:31:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2019-03-12 02:35:37 -0500

LBerger gravatar image

updated 2019-03-12 02:36:11 -0500

I don't use cmake-gui but cmake in bash (or in cmd). My cmake variables are :

-DPYLINT_EXECUTABLE="f:/Program Files/Python/Scripts/pylint.exe" \
-DFLAKE8_EXECUTABLE="f:/Program Files/Python/Scripts/flake8.exe" \
-DZLIB_INCLUDE_DIR:PATH=${installRepo}/zlib/include -DZLIB_LIBRARY_DEBUG:FILEPATH=${installRepo}/zlib/lib/${zlibname}d.lib -DZLIB_LIBRARY_RELEASE:FILEPATH=${installRepo}/zlib/lib/${zlibname}.lib \
-DPNG_PNG_INCLUDE_DIR:PATH=${installRepo}/libpng/include -DPNG_LIBRARY_RELEASE:FILEPATH=${installRepo}/libpng/lib/${pnglibname}.lib -DPNG_LIBRARY_DEBUG:FILEPATH=${installRepo}/libpng/lib/${pnglibname}d.lib \
-DEIGEN_DIR:PATH="$myRepo"/eigen -DEIGEN_INCLUDE_DIR="$myRepo"/eigen -DEIGEN_INCLUDE_PATH="$myRepo"/eigen \
-DCeres_DIR=${installRepo}/ceres-solver/cmake -Dglog_DIR:PATH=${installRepo}/glog/lib/cmake/glog -Dgflags_DIR:PATH=${installRepo}/gflags/lib/cmake/gflags \
-DPYTHON3_EXECUTABLE="f:/Program Files/Python/python.exe" \
-DPYTHON3_INCLUDE_DIR="f:/Program Files/Python/include" \
-DPYTHON3_NUMPY_INCLUDE_DIRS="f:/Program Files/Python/lib/site-packages/numpy/core/include" \
-DPYTHON3_PACKAGES_PATH="f:/Program Files/Python/lib/site-packages" \
-DWITH_OPENGL:BOOL=ON -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-DPYTHON_EXECUTABLE="C:/Program Files/Python/python.exe" \
-DTesseract_INCLUDE_DIR:PATH="${myRepo}"/Install/tesseract/include -DTesseract_LIBRARY="${myRepo}"/Install/tesseract/lib/tesseract40.lib  \
-DLept_LIBRARY="${myRepo}"/Install/leptonica/lib/leptonica-1.78.0.lib \
-DVTK_DIR:PATH="$myRepo"/install/vtk/lib/cmake/vtk-8.1 -DINSTALL_CREATE_DISTRIB=ON -DCMAKE_INSTALL_PREFIX=../../install/"$RepoSource"  ../../"$RepoSource"
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-02-19 05:43:36 -0500

Seen: 106 times

Last updated: Mar 12