Don't try to process a null image

Problem: Slower webcams take a bit of time before they actually produce images for capture.read() to consume. This caused the rest of the script to try and work on a null image, causing a crash in opencv.

Solution: Added a check that a valid image is actually being returned before processing it.

Testing: Ran on an older Windows XP machine with a slow webcam and on a newer MacBook running OSX 10.9. The XP machine no longer crashes and no new issues were noticed.