Image Motion Detection Algorithm

Thread Starter


Joined Dec 27, 2007
Hello Everyone!,

I'm trying to come up with a method to detect motion between two frames of an image. Basically, I want to take a picture, move the scene, take another picture (with at least 75% of the original scene contained), then return a vector representing the angle of movement and the relative magnitude.

I am using a 1.3M-pixel USB webcam and matlab. I am able to get the entire image into Matlab space without a problem, it's the processing that I need to figure out.

Does anyone have any idea how this is done, or how it could be done? I found a quick blurb on the internet on how I believe someone was describing how to do this, yet I am not able to decode what he is saying.

1) Use a colour camera

2) Convert to Normalized RGB to remove the effect of
illumination variation.

3) Over a protracted period, with no moving target in the
scene, calculate the mean background intensity of each
individual pixel, together with its associated standard

4) Select a confidence level (e.g. 3xsigma) whereby the
difference between the mean image and the current image is
deemed to be statistically similar - note that regions that
are naturally liable to change (e.g. trees moving) will
have a very high sigma, and will consequently be very
tolerant of any changes in the scene.

5) Generate a binary image of all regions that contain
pixels that are outside your confidence range (e.g.
Pixel_Difference > 3*PixelSigma;

6) Track your moving image using something like blob
Does this sound right? Can someone shed some light? I have the image processing and signal processing toolbox at my disposal.

All the best!,


Thread Starter


Joined Dec 27, 2007
I should have thought of that, it seems like a good tool for this. I'm going to experiment with some images in matlab and post some results.