赞
踩
首先下载opencv3.4.0,直接去官网下就好了,解压。首先要切换到root用户。
# mkdir build
# cd build
# cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
报错,Could not find a package configuration file provided by "Qt5Core" with any,这个原因是机器上同时撞了qt4和qt5的原因,安装一个qt5-default就可以
# apt-get install git build-essential qt5-default
这样可以配置成功,但实际上一路还是报了很多警告,有很多东西都没有,这个就是缺啥装啥
Looking for ccache - not found
# apt install ccache
Could NOT find Jasper (missing: JASPER_LIBRARIES JASPER_INCLUDE_DIR)
---这个没有搞定
Looking for linux/videodev.h - not found
# apt-get install libv4l-dev
#
updatedb && locate videodev.h
# ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
Looking for sys/videoio.h - not found
---这个也没有搞定,软链接建不起来,不过有人说没有关系,所以不搞了
No package 'libavresample' found
# apt-get install libavresample-dev
No package 'libgphoto2' found
# apt-get install libgphoto2-dev
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
# apt install libopenblas-base libopenblas-dev
LAPACK(OpenBLAS): CBLAS/LAPACK headers are not found in '/usr/include'
---这个要查cmake文件看CBLAS/LAPACK是啥东东了,clapack.h这个文件是有的,cblas是blas语言的c语言借口,貌似没什么用,先不管
Could NOT find Atlas (missing: Atlas_CLAPACK_INCLUDE_DIR)
---和上面差不多,先不管
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
# apt install doxygen
Could NOT find JNI (missing: JAVA_INCLUDE_PATH
这个貌似是jdk还没有装,汗
# apt install openjdk-8-jdk
Could NOT find Pylint (missing: PYLINT_EXECUTABLE)
# apt install pylint
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)
---这个也没搞定,估计要装个matlab的破解版,不过有了pytorch,还要matlab干什么
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
# apt install libvtk6-dev
ok,再次cmake一下,这次大部分东西都有了。
OpenCV modules:
-- To be built: calib3d core dnn features2d flann highgui imgcodecs imgproc java ml objdetect photo python3 python_bindings_generator shape stitching superres ts video videoio videostab viz
-- Disabled: js world
-- Disabled by dependency: -
-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python2
-- Applications: tests perf_tests examples apps
-- Documentation: YES (/usr/bin/doxygen 1.8.13)
-- Non-free algorithms: NO
--
-- GUI:
-- QT: YES (ver 5.7.1)
-- QT OpenGL support: YES (Qt5::OpenGL 5.7.1)
-- GTK+: NO
-- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGLU.so /usr/lib/x86_64-linux-gnu/libGL.so)
-- VTK support: YES (ver 6.3.0)
--
-- 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: /usr/lib/x86_64-linux-gnu/libwebp.so (ver encoder: 0x0209)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.28)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.0.8)
-- JPEG 2000: build (ver 1.900.1)
-- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2.2.0)
--
-- Video I/O:
-- DC1394: YES (ver 2.2.5)
-- FFMPEG: YES
-- avcodec: YES (ver 57.64.101)
-- avformat: YES (ver 57.56.101)
-- avutil: YES (ver 55.34.101)
-- swscale: YES (ver 4.2.100)
-- avresample: YES (ver 3.1.0)
-- GStreamer:
-- base: YES (ver 1.10.4)
-- video: YES (ver 1.10.4)
-- app: YES (ver 1.10.4)
-- riff: YES (ver 1.10.4)
-- pbutils: YES (ver 1.10.4)
-- libv4l/libv4l2: NO
-- v4l/v4l2: linux/videodev.h linux/videodev2.h
-- gPhoto2: YES
--
-- Parallel framework: pthreads
--
-- Trace: YES (with Intel ITT)
--
-- Other third-party libraries:
-- Intel IPP: 2017.0.3 [2017.0.3]
-- at: /home/fire/fire/opencv/opencv-3.4.0/build/3rdparty/ippicv/ippicv_lnx
-- Intel IPP IW: sources (2017.0.3)
-- at: /home/fire/fire/opencv/opencv-3.4.0/build/3rdparty/ippicv/ippiw_lnx
-- Lapack: NO
-- Eigen: YES (ver 3.3.2)
-- Custom HAL: NO
--
-- NVIDIA CUDA: NO
--
-- OpenCL: YES (no extra features)
-- Include path: /home/fire/fire/opencv/opencv-3.4.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
--
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.5.3)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (ver 3.5.3)
-- numpy: /usr/local/lib/python3.5/dist-packages/numpy/core/include (ver 1.14.0)
-- packages path: lib/python3.5/dist-packages
--
-- Python (for build): /usr/bin/python2.7
-- Pylint: /usr/bin/pylint (ver: 1.6.5, checks: 113)
--
-- Java:
-- ant: /usr/bin/ant (ver 1.9.9)
-- JNI: /usr/lib/jvm/java-8-openjdk-amd64/include /usr/lib/jvm/java-8-openjdk-amd64/include/linux /usr/lib/jvm/java-8-openjdk-amd64/include
-- Java wrappers: YES
-- Java tests: YES
--
-- Matlab: NO
--
-- Install to: /usr/local
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fire/fire/opencv/opencv-3.4.0/build
接下去就是make了
# make
# make install
make过程很长,就先结束本文吧。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。