Page 1 of 1

deleting duplicates in an image list

Posted: 2014-07-06T09:11:08-07:00
by gubach
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!!

Re: deleting duplicates in an image list

Posted: 2014-07-06T10:47:15-07:00
by snibgo
Perhaps perl has the equivalent of the command-line option "-layers remove-dups". See http://www.imagemagick.org/script/comma ... php#layers