The biggest difficulty with installing OPENCV under MACOSX is to coordinate the Python version. Because on the OPENCV website, it is highly recommended to install the full version of Python (not recommended with the Mac built-in Python), so you will encounter this multiple Python version, resulting in OpenCV installation failure
1. Install Brew
2. Install python (download the installation package directly on the website) and click on the. dmg file to install Python.
The Idel, Pythonlauncher, buildapplet Three apps are added in the list of applications.
At the same time, the system default Python is replaced with the new version, the new version of the installation path
/library/frameworks/python.framework/versions/2.7//library/frameworks/python.framework/versions/ 2.7/lib/python2. 7/site-package #官方 python installation package path
Apple OSX default Python installation path
/system/library/frameworks/python.framework/versions/2.7/library/python/2.7/site-packages #osx Python installation package path
3. Installing numpy,scipy
4. Installing OPENCV
4.1 Download OpenCV Source code
cd/usr/local/opencv-2.4.10
mkdir Release
CD release
cmake-d python_executable=/library/frameworks/python.framework/versions/2.7/bin/PYTHON -D python_packages_path=/library/frameworks/python.framework/versions/2.7/lib/python2. 7/site-packages -Dinstall_python_examples= on-D python_include_dir=/library/ frameworks/python.framework/versions/2.7/Headers -D python_library=/library/frameworks /python.framework/versions/2.7/lib/libpython2. 7 . Dylib.
Make-j8
Make install
Specifying these parameters here is key, and if you do not specify these parameters, you may turn OpenCV to the default python.
For more parameters see OpenCV home directory CMakeList.txt file
Reference:
Http://www.tuicool.com/articles/q263ym
Http://stackoverflow.com/questions/7128761/how-to-properly-install-python-on-osx-for-use-with-opencv
OpenCV segmentation Fault:11
"Mac OSX installation Opencv,python Summary"