我在构建OpenCV 3和贡献matlab模块时遇到了问题,
我使用以下方式构建它:
cmake -D MATLAB_ROOT_DIR=/usr/local/MATLAB/R2014a/bin -DOPENCV_EXTRA_MODULES_PATH=/home/me/OpenCV/opencv/opencv_contrib-master/modules /home/me/OpenCV/opencv -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
然而,它失败了一些模块,包括matlab,这是我目前所需要的。
虽然它确实找到了它不生成/构建的mex并在Unavailable模块下显示它。
我很欣赏任何关于可能是什么原因以及如何解决它的想法。谢谢!
Matlab:
-- mex: /usr/local/MATLAB/R2014a/bin/mex
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- To enable PlantUML support, set PLANTUML_JAR environment variable or pass -DPLANTUML_JAR=<filepath> option to cmake
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7")
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4", minimum required is "3.4")
-- Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable exact version "3.4.0")
-- Could NOT find Matlab (missing: MATLAB_ARCH)
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
答案 0 :(得分:1)
来自https://github.com/Itseez/opencv/blob/master/cmake/OpenCVFindMatlab.cmake我不认为MATLAB_ROOT_DIR
应该包含/bin
,因为他们会在第139行${MATLAB_ROOT_DIR}/bin
您也不需要设置MATLAB_ROOT_DIR
,因为该脚本在第63行显式检查/ usr / local for matlab set(SEARCH_DIRS_ /Applications /usr/local /opt/local /usr /opt)