I have a list with downscaled black-and-white images ($mask_segment_list_dual) generated by an image processing pipeline and I want to delete duplicates in the list. In the command line tools I found
Code: Select all
compare -metric AE (or MAE) image1.png image2.png null: 2>&1
that delivers 0 if the two images are the same
http://www.imagemagick.org/Usage/compare/#statistics. This is working fine when the images are on Harddisk. I have experimented in PerlMagick with lines like
Code: Select all
$mask_segment_list_dual->[0]->Compare(image=>$mask_segment_list_dual->[1], metric=>'AE')
but I could not get it right. How can I compare for example the first two images in the list and got a comparison value in a Perl variable?
Or even better has someone an efficient general solution for deleting duplicates in an image list (preserving of positions in the list is not necessary)? Thanks!!