I have a patch that adds an RMS Difference method to the PIL.
Let me know if there is any interest in this. I originally wrote this to
help implement a video stabilization filter. You could also use
this to quantify how much a lossy compression algorithm distorts
an image relative to some other compression algorithm. I thought
others might find RMS Difference useful.

    http://www.noah.org/wiki/PIL_patches

This is a patch against the Python Imaging Library Imaging-1.1.6.
This adds the method ImageChops.difference_rms(im1, im2) which
returns a float of the RMS difference between the two given
images, im1 and im2. This is about 10 times faster than doing it
in Python. The RMS Difference can be used to detect and compare
changes in images (say, for motion detection) or to compare the
effect of different image operations. If the two images are
exactly equal then difference_rms() will return 0.0. As the
images diverge the RMS value returned will increase. It will
always be a positive number. In general, the greater the
difference between the two images then the greater the RMS
difference will be.

In video stabilization I take two frames of a video and shift one
of them around until the RMS Difference is minimized.

-- 
  Noah Spurrier | email: [EMAIL PROTECTED]
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to