2020-12-01 20:24

opencv 3.0 build error (possible resolution: QT gui issues)

Hi, Paul,

As the OpenDTAM is towards the target opencv 3.0, I plan to shifted into new opencv 3.0 environment. But I came across the build error as follows:

[ 42%] Building CXX object modules/calib3d/CMakeFiles/opencv_calib3d.dir/src/stereosgbm.cpp.o [ 42%] Building CXX object modules/calib3d/CMakeFiles/opencv_calib3d.dir/src/dls.cpp.o /root/Downloads/opencv-3.0/modules/calib3d/src/dls.cpp:11:31: fatal error: Eigen/Eigenvalues: No such file or directory compilation terminated. make[2]: * [modules/calib3d/CMakeFiles/opencv_calib3d.dir/src/dls.cpp.o] Error 1 make[1]: * [modules/calib3d/CMakeFiles/opencv_calib3d.dir/all] Error 2 make: *** [all] Error 2

Before, the output from cmake-gui is as follows:

Detected version of GNU GCC: 46 (406) Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "", required is "1.2.3") Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "") Found OpenEXR: /usr/lib/libIlmImf.so checking for module 'gstreamer-base-1.0' package 'gstreamer-base-1.0' not found checking for module 'gstreamer-video-1.0' package 'gstreamer-video-1.0' not found checking for module 'gstreamer-app-1.0' package 'gstreamer-app-1.0' not found checking for module 'gstreamer-riff-1.0' package 'gstreamer-riff-1.0' not found checking for module 'gstreamer-pbutils-1.0' package 'gstreamer-pbutils-1.0' not found Looking for linux/videodev.h Looking for linux/videodev.h - not found Looking for linux/videodev2.h Looking for linux/videodev2.h - found Looking for sys/videoio.h Looking for sys/videoio.h - not found Looking for libavformat/avformat.h Looking for libavformat/avformat.h - found Looking for ffmpeg/avformat.h Looking for ffmpeg/avformat.h - not found found IPP (ICV version): 8.1.1 [8.1.1] at: /root/Downloads/opencv-3.0/3rdparty/ippicv/unpack/ippicv_lnx CUDA detected: 5.5 CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30 Could NOT find PythonInterp: Found unsuitable version "2.7.3", but required is at least "3.4" (found /usr/bin/python) Could NOT find PythonInterp: Found unsuitable version "2.7.3", but required is at least "3.2" (found /usr/bin/python) Found Sphinx 1.1.3: /usr/bin/sphinx-build Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH) Could NOT find Matlab (missing: MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS MATLAB_ROOT_DIR MATLAB_LIBRARIES MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN) VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file

General configuration for OpenCV 3.0.0-dev ===================================== Version control: unknown

Platform: Host: Linux 3.8.0-29-generic x86_64 CMake: 2.8.9 CMake generator: Unix Makefiles CMake build tool: /usr/bin/make Configuration: Release

C/C++: Built as dynamic libs?: YES C++ Compiler: /usr/bin/c++ (ver 4.6.3) 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 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-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 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG C Compiler: /usr/bin/gcc 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 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -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 -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -msse3 -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG Linker flags (Release):
Linker flags (Debug):
Precompiled headers: YES

OpenCV modules: To be built: cudev core flann imgproc imgcodecs videoio highgui features2d calib3d cudaarithm ml objdetect cudalegacy cudawarping cuda cudafilters cudaimgproc video cudabgsegm cudacodec cudafeatures2d cudaoptflow cudastereo photo shape stitching superres videostab python2 ts Disabled: world Disabled by dependency: - Unavailable: androidcamera java python3 viz

GUI: QT 5.x: YES (ver 5.0.2) QT OpenGL support: NO OpenGL support: NO VTK support: NO

Media I/O: ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver ) WEBP: build (ver 0.3.1) PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.2.46) TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 - 3.9.5) JPEG 2000: /usr/lib/x86_64-linux-gnu/libjasper.so (ver 1.900.1) OpenEXR: /usr/lib/libImath.so /usr/lib/libIlmImf.so /usr/lib/libIex.so /usr/lib/libHalf.so /usr/lib/libIlmThread.so (ver 1.6.1) GDAL: NO

Video I/O: DC1394 1.x: NO DC1394 2.x: YES (ver 2.2.0) FFMPEG: YES codec: YES (ver 53.35.0) format: YES (ver 53.21.1) util: YES (ver 51.22.2) swscale: YES (ver 2.1.0) gentoo-style: YES GStreamer:
base: YES (ver 0.10.36) video: YES (ver 0.10.36) app: YES (ver 0.10.36) riff: YES (ver 0.10.36) pbutils: YES (ver 0.10.36) OpenNI: NO OpenNI PrimeSensor Modules: NO OpenNI2: NO PvAPI: NO GigEVisionSDK: NO UniCap: NO UniCap ucil: NO V4L/V4L2: Using libv4l (ver 0.8.6) XIMEA: NO Xine: NO

Other third-party libraries: Use IPP: 8.1.1 [8.1.1] at: /root/Downloads/opencv-3.0/3rdparty/ippicv/unpack/ippicv_lnx Use IPP Async: NO Use Eigen: YES (ver 2.0.17) Use TBB: NO Use OpenMP: NO Use GCD NO Use Concurrency NO Use C=: NO Use Cuda: YES (ver 5.5) Use OpenCL: YES

NVIDIA CUDA Use CUFFT: YES Use CUBLAS: NO USE NVCUVID: NO NVIDIA GPU arch: 11 12 13 20 21 30 35 NVIDIA PTX archs: 30 Use fast math: NO

OpenCL: Version: dynamic Include path: /root/Downloads/opencv-3.0/3rdparty/include/opencl/1.2 Use AMDFFT: NO Use AMDBLAS: NO

Python 2: Interpreter: /usr/bin/python2.7 (ver 2.7.3) Libraries: /usr/lib/libpython2.7.so (ver 2.7.3) numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.6.1) packages path: lib/python2.7/dist-packages

Python 3: Interpreter: NO

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

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

Matlab: mex: NO

Documentation: Build Documentation: YES Sphinx: /usr/bin/sphinx-build (ver 1.1.3) PdfLaTeX compiler: /usr/bin/pdflatex PlantUML: NO

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

Install path: /usr/local

cvconfig.h is in: /root/Downloads/opencv-3.0/release

Configuring done Generating done

It seems very strange that the system cannot find "Eigen/Eigenvalues" while the cmake-gui could recognize EIGEN in "/usr/include/eigen2". Could you give me some suggestions on how to fix it?

Best regards, Milton


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • weixin_39517560 weixin_39517560 4月前

    Ah. You should actually use my opencv fork for building the 3.0 version because it has the pull request already incorporated. I have given up trying to compile the trunk directly anyway, the build sytem is far too convoluted for me to debug.

    点赞 评论 复制链接分享
  • weixin_39955700 weixin_39955700 4月前

    Thanks Paul. The building step of opencv 3.0 succeeded after using your opencv fork. Then I downloaded the most recent version of OpenDTAM and built it successfully. But when I run it by "./a.out", something failed after the initialization of first 500 frames. It shows as follows:

    text_file_name = ../../Trajectory_30_seconds/scene_498.txt Opening: ../../Trajectory_30_seconds/scene_498.png text_file_name = ../../Trajectory_30_seconds/scene_499.txt Opening: ../../Trajectory_30_seconds/scene_499.png Paused: Space (in GUI window) to continue

    (A function:2822): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

    (A function:2822): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

    All the windows (Actual Image, Control, D function, A function, Predicted Image, etc..) had popped out but only in black screen. And I found that my GPU was running. Could you suggest me how to fix it?

    Best regards, Milton

    点赞 评论 复制链接分享
  • weixin_39517560 weixin_39517560 4月前

    Sorry, I've been out for a while. I have seen this error before, but forget what was wrong. I think it may have been that QT wasn't actually working. Try calling displayOverlay to see if it is working. You could also try calling imwrite after imshow from inside the graphics.cpp file to see if the expected image is getting to the graphics routines

    点赞 评论 复制链接分享
  • weixin_39833763 weixin_39833763 4月前

    : I had the same issue, and I could not exactly solve it. However, removing the line 119 in graphics.cpp did the trick for me: namedWindow("control",WINDOW_NORMAL);

    I also have a weird bug, with waitKey(0) always returning 1 but that's another problem and easy to go around...

    点赞 评论 复制链接分享
  • weixin_39517560 weixin_39517560 4月前

    Yep, almost certainly a problem with the new QT interface then. The "WINDOW_NORMAL" attribute converts a window to one without the nice QT viewer features.

    点赞 评论 复制链接分享
  • weixin_39656853 weixin_39656853 4月前

    (A function:2822): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

    I don't know if this will help you guys, but I just solved this error in my own code. I had a window open with a few track bars without any image being shown inside the window. I continually got the above error because of that control window. Then I added an image to the window and the error went away. I think this error is simply because my control window was not given a picture or video. I was googling that specific error and came across this bug. I hope this helps you out.

    点赞 评论 复制链接分享