Extracting sticker colors on Rubik's cube from video

Abstract
This project tackles the problem of real-time object detection and localization. More specifically, we attempt to locate a Rubik’s Cube in a video stream and extract the sticker colors with minimal help from the user. The edge based approach we take is invarient to various camera settings and does not assume a particular color scheme for the cube.
Video

PDF

 

The report detailing the technique used can be found here

 

Code

The program is implemented as a single Python script. You need the OpenCV 2.1 Python bindings and numpy library.
This is research code so it is not pretty.

If your cube is black you can improve results by pressing 'b'.

cubefinder.py