This post is about getting started with Computer Vision. It’s starts off with OpenCV 2.0, then moves onto OpenCV 3.1.2. At the time of write this post version 3.4.1 has been released.

I’m going to cover a quick introduction and getting the following below:

  1.  Quick Start to OpenCV 2.0 on Raspberry Pi
  2.  OpenCV 3.x on Ubuntu/Raspberry Pi
  3. TensorFlow, Darknet and Yolo

Quick Start to OpenCV on Raspberry Pi

So I just wanted to get it up and running. I had an Raspberry Pi at home. I ordered a 5MP Pi Camera not the latest one as you don’t need an 8MP camera module as the processor couldn’t process the stream of images at this resolution.

  1. Install the latest Raspbian OS onto the PI. Download the image from and use the cool little application Etcher to flash your micro SD card.
  2. Once you get the Pi to boot, run the command below. Enable the camera module. You can also overclock the Pi for a performance boost but for now leave it as default.
    sudo raspi-config
  3. Ok you’ll need Python and OpenCV
    sudo apt-get install python-opencv
    sudo pip install imutils
  4. Now test your camera, if you see an image you’re good to go. Otherwise check the cable is connected correctly. I actually plugged mine in the wrong way around the first time, Doh!
    raspistill -o cam.jpg
  5. You can download the face tracking sample code using haar cascade from here.
  6. For more in depth how the code work read –
Raspberry Pi and Camera

Raspberry Pi and Camera

Face detection in low light

Face detection in low light

This short procedure will get you up and running however to do more serious stuff you’ll need OpenCV 3+. But this demo works very well even in low light.

The next post I’ll cover OpenCV 3+