I got stuck with the method of installing OpenCV on Mac, but I solved it at the following site, so I will write it as a memorandum
http://www.daveperrett.com/articles/2010/12/14/face-detection-with-osx-and-python/
I referred to this site.
First you need to install HomeBrew.
http://brew.sh/index_ja.html
Refer to this site
Updating HomeBrew
brew update
brew install -v cmake
You also need to tap
brew tap homebrew/science
Install OpenCV with Homebrew
brew install opencv
Then pass the path The following path is the old way
export PYTHONPATH="/usr/local/lib/python2.6/site-packages/:$PYTHONPATH"
I'm using python2.7 now, so rewrite it like this
export PYTHONPATH="/usr/local/lib/python2.7/site-packages/:$PYTHONPATH"
Then launch python, test it and it should work
> python
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>>
Please comment if you make a mistake
Recommended Posts