views:

13

answers:

0

Hi, i need to compare 2 .pgm images in java. I use this to display the image:

PlanarImage pgmImage = JAI.create("fileload", "test.pgm");
 ImageIcon icon = new ImageIcon(pgmImage.getAsBufferedImage());

The comparing type is:

Image A, px 1 = 220; Image A, px2 =....; Image A pxN=...;

Image B, px 1 = 180; Image B, px2=....; Image A pxN=...;

The result = 220-180

I need to get the difference of each 2 pixels.

Can you help me, or suggest algoritm? Thanks.