brew tap homebrew/science
brew install opencv
cd /Library/Python/2.7/site-packages/
sudo ln -s /usr/local/Cellar/opencv/2.4.13.2/lib/python2.7/site-packages/cv.py cv.py
sudo ln -s /usr/local/Cellar/opencv/2.4.13.2/lib/python2.7/site-packages/cv2.so cv2.so
cd ~
touch .bash_profile
open -e .bash_profile
在.bash_profile 中输入 export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages
source .bash_profile
// 测试代码
import cv2
img=cv2.imread("IMG_2942.png")
cv2.namedWindow("Image")
cv2.imshow("Image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()