I wanted to run OpenCV from the latest sources, with python3 bindings, on macos. I decided to use an ubuntu virtual machine, provisioned by Vagrant.
You can install vagrant and virtualbox easily by using brew
Next step is to simply clone my project containing the Vagrantfile and the script for the provisioning.
Once in the
opencv-vagrant directory, you can spin the virtual box with
This command will initialise the machine and run the provisioning script; which in turn will install all the dependencies, OpenCV from the latest sources, and configure a virtualenv with jupyter. It will take some time.
When the provisioning script will be over, you can access the box with
Once in the box shell, you can activate the virtualenv enviroment named
cv and run jupyter
At this point you can direct your (host) browser to http://localhost:8888, leave empty the password field and access a demo notebook.
One more thing: if you want to update all the packages installed and OpenCV itself, it is a matter to start the virtual box and forcing the provisioning again, by using the command: