Getting OpenCV 3 with contributions (e.g., SIFT) to work with Python 3.5 on a Mac OS X

This has got to be the most mis-documented thing on the web.  To save you the hours I spent spinning around on this, assuming you have homebrew:

brew install opencv3 --with-python3 --with-contrib

So many websites want you to check out a bunch of GIT repositories and build stuff by hand.  I have no idea why.  You may need other pre-requisites to make this work (probably Xcode command line tools), but they’re each not hard to find and install.  And of course you need python, numpy, and probably scipy to make it all work.

I don’t have a “virgin” system to try it on, so I can’t give a complete set of steps, but homebrew is very good at telling you what’s missing and getting it for you.

Hope this helps.

Postnote:

Afterwards, I needed to make sure I could process video files, and so I did:

brew reinstall opencv3 --with-python3 --with-contrib --with-ffmpeg
Posted in Uncategorized