This is my current method:
#Object to compare images
my $cmp = Image::Compare->new();
# Resize images
my ($image_1_resized_file, $image_2_resized_file) = resize_images($image_1_file, $image_2_file);
# Configure comparison
$cmp->set_image1(
img => $image_1_resized_file,
type => 'png',
);
$cmp->set_image2(
img => $image_2_resized_file,
type => 'png',
);
$cmp->set_method(
method => &Image::Compare::EXACT,
);
# Compare
if ($cmp->compare()) {
print "[DEBUG] Images are the same\n" if ($self->{_debug_prints} eq 1);
# Remove temp files
unlink $image_1_resized_file;
unlink $image_2_resized_file;
return 1;
}
else {
print "[ERROR] Images are not the same\n";
#Remove temp files
unlink $image_1_resized_file;
unlink $image_2_resized_file;
return 0;
}
}
Ommiting the resizing that I do, If the images are the same, is there a fastest way to do this?. Currently is taking around 2-5 seconds per image, with an aproximated size of 600x600.
Considering that I want to test blocks of 10 images around 40 times, is there a fastest way to get the results?