Install OpenCV with homebrew on Mac OSX and Python 3

OpenCV appears to only be able to install on one version of python at once. There are a ton of outdated blog posts on how to do this – at the time of writing this one works.

brew reinstall opencv@3 --with-python3 --without-python

Then in python:

import cv2

Run the script:

python3 test.py