Hello everyone.

I would like to create an application that do the following thing:
The camera is looking into a wall(any white block) and starting a timer, once I shut down the light in my room the camera will detect it and stop the timer.
The timer part is easy but how can I use the camera to detect a change and react to it by stopping the timer?

A link to an article about that issue would be nice to,