0
I’m trying to make a code in Java that compares an input image with other n images already defined in the code. I developed, with (quite) help, a similar code, which compared two images only, the problem is to enlarge it. Take a single image and go comparing with several others, I’m not able to do.
What I got:
public static boolean compareImage(BufferedImage image1, BufferedImage image2){
if (image1.getWidth()!= image2.getWidth()|| image1.getHeight() != image2.getHeight()){
return(false);
}
for (int x=0; x<image1.getWidth(); x++){
for(int y=0; y<image1.getHeight(); y++){
if(image1.getRGB(x,y)!=image2.getRGB(x,y)){
return(false);
How about transforming the images to be compared into a list and make a loop passing each entry of that list as a parameter, and the image you want to compare with this list as another parameter?
– user28595
It’s exactly the part of making this list that I get lost in, I don’t know exactly how to list the images.
– Bruno Almeida