Extracting appliance state from a webcam photo (computer vision)

this may help you