opencv 在mac上xcode的安裝
阿新 • • 發佈:2019-01-23
引自:
http://seeb0h.github.io/howto/howto-install-homebrew-python-opencv-osx-el-capitan/Thanks to Homebrew, this is fairly easy. Follow these steps .
Homebrew
This up-to-date guide covers everything you need to know, including how to fix a broken brew installation caused by OS X upgrade.
With a fresh OSX install, I only need these steps :
-
XCode Command Line tools:
xcode-select --install
-
Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Check installation
brew doctor
OpenCV/Python 2
I have choosen this flavour.
Python 2
Most OpenCV sample scripts don’t run with Python 3. In 4 steps :
brew install python
brew linkapps python
brew install gcc
sudo pip install -U numpy scipy matplotlib scikit-learn scikit-image
OpenCV
You may choose between OpenCV3 and OpenCV2
OpenCV3
Without OpenCL (better on my old 2010 laptop) :
brew install tesseract
brew tap homebrew/science
brew install opencv3 --with-contrib
ln -s /usr/local/opt/opencv3/lib/python2.7/site-packages/cv2.so /usr/local/lib/python2.7/site-packages/
OpenCV2
Without OpenCL (better on my old 2010 laptop) :
brew install tesseract
brew tap homebrew/science
brew install opencv
OpenCV/Python 3
Python 3
brew install python3
brew install gcc
sudo pip3 install -U numpy scipy matplotlib scikit-learn scikit-image
OpenCV
You may choose between OpenCV3 and OpenCV2
OpenCV3/Python 3
brew install opencv3 --with-python3
ln -s /usr/local/opt/opencv3/lib/python3.5/site-packages/cv2.cpython-35m-darwin.so /usr/local/lib/python3.5/site-packages/
OpenCV2/Python 3
brew install opencv --with-python3