Darrel said:
Whats the best way to compare 2 images to see if they are exactley the same?
Specifically, a BufferedImage and a sun.awt.windows.WImage.
My plan is to convert the WImage into a BufferedImage. Then verify that
they are the same size. Then iterate thru each pixel rgb value. Is there a
better way?
Tx, Darrel
One way to do this is with Fourier Transform. By comparing the magnitude
and phase of the transform you can determine if one image is the same as
another only under some type of transform such as scale rotation, or
translation.
Here are some sites that may be useful:
http://www.dai.ed.ac.uk/HIPR2/fourier.htm
http://www.mathworks.com/access/helpdesk/help/toolbox/images/transfo5.shtml
http://www.cs.unm.edu/~brayer/vision/fourier.html
Google for:
Fourier-Based Image Registration Techniques &
Fourier-Mellin Transforms for Image Registration
It is popular in research because it has possibilities with image
watermarking as well as image recognition for robots and the like.
Another thing you could to is simply take one image and subtract the
other. This would probably be the easiest. I know Jimage can do this and
I am sure there are alot of others. basically subtract pixel for pixel
and take the absolutes value of the result. The resultant image should
be white were the images match and colored were the images do not.
You can then count the non white pixels or do a image histogram of the
results.
Mark