当前位置:  开发笔记 > 编程语言 > 正文

使用opencv_contib安装OpenCV 3.2时未指定"OPENCV_TEST_DATA_PATH环境变量"

如何解决《使用opencv_contib安装OpenCV3.2时未指定"OPENCV_TEST_DATA_PATH环境变量"》经验,为你挑选了0个好方法。

我正在尝试在Ubuntu 16.04上安装OpenCV 3.2和opencv_contrib中的模块.

但是,当我运行该sudo make install命令时,我得到以下输出:

?  build git:(master) sudo make install
-- Detected version of GNU GCC: 54 (504)
-- FP16: Feature disabled
-- Found ZLIB: /usr/lib64/libz.so (found suitable version "1.2.8", minimum required is "1.2.3") 
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.8") 
-- 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
-- Checking for module 'libavresample'
--   No package 'libavresample' found
-- Checking for module 'libgphoto2'
--   No package 'libgphoto2' found
-- Found TBB: /usr/lib64/libtbb.so
-- found IPP (ICV version): 9.0.1 [9.0.1]
-- at: /home/denis/code/opencv/build/3rdparty/ippicv/ippicv_lnx
-- CUDA detected: 8.0
-- CUDA NVCC target flags: -gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-D_FORCE_INLINES
-- LAPACK_IMPL: OpenBLAS, LAPACK_LIBRARIES: /opt/OpenBLAS/lib/libopenblas.so
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
-- 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
-- Caffe:   NO
-- Protobuf:   YES
-- Glog:   YES
-- freetype2:   YES
-- harfbuzz:    YES
-- Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
-- Assume that non-module dependency is available: freetype (for module opencv_freetype)
-- Assume that non-module dependency is available: harfbuzz (for module opencv_freetype)
CMake Error at /home/denis/code/opencv_contrib/modules/dnn/CMakeLists.txt:84 (message):
  OPENCV_TEST_DATA_PATH environment variable was not specified


-- Configuring incomplete, errors occurred!
See also "/home/denis/code/opencv/build/CMakeFiles/CMakeOutput.log".
See also "/home/denis/code/opencv/build/CMakeFiles/CMakeError.log".
Makefile:10450: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

事情是,我正在非常努力的时候运行相同的错误make -j8命令,然后我添加的OPENCV_TEST_DATA_PATH环境变量,我~/.bashrc~/.zshrc文件是这样的:

export OPENCV_TEST_DATA_PATH=/home/denis/code/opencv_extra/testdata

我事先已经下载了opencv_extra repo.错误消失了!我可以成功运行make -j8命令.

运行该make -j8命令后,我尝试运行该sudo make install命令并获得您在上面看到的输出.

指定了此环境变量:

?  build echo $OPENCV_TEST_DATA_PATH
/home/denis/code/opencv_extra/testdata

所以,我不太清楚我该怎么做才能正确安装OpenCV.

PS:这是cmake我使用的命令:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -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 -D WITH_CUBLAS=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..

你能帮我解决这个问题吗?

推荐阅读
依然-狠幸福
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有