August 4, 2012

Install OpenCV+Python on OSX Snow Leopard

OSX Snow Leopard
X-code v4.0.2

The reason I failed to install it with other methods is that everyone's environment is a bit different, and some tutorials are outdated.  So check your environment against mine and if it's not what you have, then please find other tutorials.

  1. install mac port, if it's already installed clean it up (e.g. sudo port -f clean --all all)
  2. mv /usr/local /usr/local.bak (remember to change it back later)
  3. sudo port install opencv +python27 configure.compiler=clang

(Help from:


  • It's easier to experiment with Python.
  • What I'd like to try with OpenCV is to feed photos and videos to recognize faces and add meta tags to the photo, and make it more searchable.  Picasa already has that feature for photos, but not for videos.
  • Using MacBook's built-in webcam, the face detection works great.

Other How-To's

OpenCV and Python