項目中使用的是opencv 2的版本,所以下面說一下opencv2的一些安裝流程。python
安裝命令: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Kevin:~ kai$ brew -v Homebrew 1.3.1 Homebrew/homebrew-core (git revision 7cb8; last commit 2017-08-10)
brew install opencv@2
cd /Library/Python/2.7/site-packages/
ln -s /usr/local/Cellar/opencv@2/2.4.13.2_2/lib/python2.7/site-packages/cv.py cv.py ln -s /usr/local/Cellar/opencv@2/2.4.13.2_2/lib/python2.7/site-packages/cv2.so cv2.so
cd ~git
touch .bash_profilegithub
open -e .bash_profileruby
在.bash_profile 中輸入 export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages 。再保存環境變量。bash
source .bash_profilepython2.7
>>>import cv2 >>>
pip install numpy==1.13.1
圖:
