Working code from Chapter 3 of 'Mastering OpenCV with Practical Computer Vision Projects'. This is an edit of the original made to work in VS2010 on Windows 7.