opencv opencv_contrib克隆到我的~/code
路径
在mac上使用pyenv和python 3.5.2(在--with_framework上安装)
执行:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=$HOME/code/opencv_contrib/modules \
-D PYTHON3_LIBRARY=$HOME/.pyenv/versions/3.5.2/Python.framework/Versions/3.5/lib/libpython3.5m.dylib \
-D PYTHON3_INCLUDE_DIR=$HOME/.pyenv/versions/3.5.2/include/python3.5m \
-D PYTHON3_EXECUTABLE=$HOME/.pyenv/versions/3.5.2/bin/python \
-D PYTHON3_DEFAULT_EXECUTABLE_HOME=$HOME/.pyenv/versions/3.5.2/bin/python3.5 \
-D PYTHON_PACKAGES_PATH=$HOME/pyenv/versions/3.5.2/lib/python3.5/site-packages \
-D PYTHON_NUMPY_INCLUDE_DIRS=$HOME/.pyenv/versions/3.5.2/lib/python3.5/site-packages/numpy/core/include/numpy \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_EXAMPLES=ON ..
但输出仍然是:
-- Python 2:
-- Interpreter: /Users/me/.pyenv/shims/python2.7 (ver 2.7.13)
--
-- Python 3:
-- Interpreter: /Users/me/.pyenv/versions/3.5.2/bin/python (ver 3.5.2)
-- Libraries: NO
-- numpy: NO (Python3 wrappers can not be generated)
-- packages path:
--
-- Python (for build): /Users/me/.pyenv/shims/python2.7
不再需要尝试question
了