In Processing, I made use of the “Video” library to do some frame differencing on the feed from my webcam. I would compare color levels, and if the difference exceeded a certain threshold, a red dot would be drawn:

Seen in the above picture, the specified threshold is 50% difference. To adjust this value, I hooked up the Arduino and a switch circuit. When the switch was turned on, the threshold would steadily rise (looping back to zero once it hit 100%), and when turned off, it would maintain the current threshold level.
The point of this is so I can calibrate the threshold, and determine what the optimal value is for a given situation.