I am writing an application that takes snapshot images!

I would like to be able to call a function that will take any two images and give me an indicator that they have changed.

Basically a diff type function that would return a number indicating the threshold of the change.

ie. lDiff = jpregcompare(IMAGE1,IMAGE2) returns long;

lDiff would get some kind of number that I could use to determine weather or not the image changed enough for me to take action.

ie. video surveillance, turn on VCR, turn on Lights, ...etc

Anyone got any code or controls that will let you mess around like this????