Frame differencing is a technique where the computer checks the difference between two video frames. If the pixels
have changed there apparently was something changing in the image (moving for example).
Most techniques work with some blur and threshold, to distict real movement from noise. Because frame could differ
too when light conditions in a room change ( and camera auto focus, brightness correction etc. ).
You can move objects to area’s where most of the motion is happening, like in the Pong example of Ostrich :
Ostrich two cursors example
Or you can make some hotspots in your image and check the amount of motion in those. A nice example to get the idea is the webcam piano from Memo Akten (implemented in Quartz Composer and Processing) :
Code examples and tutorials
|Ostrich Flash (Flash feathers)
|Webcam motion detection by Soulwire
|Webcam Motion Detection by Guy Watson
|Webcam Piano by Memo Akten
|Poping Bubbles with OpenCV library by Andy Best
|Frame differencing code example by Golan Levin
If you only want to detect if there is a certain amount of motion in front of a webcam, you can use the activityHandler and activityLevel parameters in Flash. See my example on bitmap filters where i use it the apply a red filter when there is movement :
Flash AS3 : Apply bitmap filters to a webcam image