[Mac] OpenCV + Python

openCV 2.x + Python 2.x on MacOS

brew 安裝 python

$ brew install python

安裝 cmake

$ brew install cmake

安裝 openCV 2.x

$ brew install homebrew/science/opencv

會有警告訊息

Warning: opencv dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.

不理他 可以用

安裝 numpy

$ pip install numpy

安裝完 /Library/Caches/Homebrew/opencv-2.4.11.tar.gz 有範例

$ mkdir dev
$ cd dev
$ tar xvfz /Library/Caches/Homebrew/opencv-2.4.11.tar.gz
$ cd opencv-2.4.11/sample/python2
$ python demo.py

如果用人臉辨識 特徵在 data/haarcascades

[筆記] PyQt4

MacOS 安裝

Homebrew 安裝

brew install pyqt

記得要把path加入 不然python找不到

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Windows 筆記

winpython 安裝

安裝後記得執行script註冊path

PyQt的程式副檔名以 .pyw 代替 .py 可以讓命令提示字元(cmd)的視窗隱藏