"Mac OSX installation Opencv,python Summary"

Source: Internet
Author: User
Tags install brew

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.