At the moment, your code will always compare the 2000.png file with 2002.png. First reformat your comparison code to a method:
CompareResult compare(BufferedImage img1,BufferedImage img2) { ... }
Declare a CompareResult class to group result information into a single message:
class CompareResult { long pixMatched; long pixVar; ... }
Then expect a list of image files from the command line and sum them up with each other:
for(int i=0;i<args.length();i++) { BufferedImage img1 = ImageIO.read(args[i]); for (int j=i+1;j<args.length();j++) { BufferedImage img2 = ImageIO.read(args[j]); CompareResult r = compare(img1,img2); printInfo(r); } }
PeterMmm Jan 17 '14 at 9:58 a.m. 2014-01-17 09:58
source share