How to convert and get a metric in one command?
Posted: 2008-03-21T13:58:02-07:00
I'm comparing, thresholding, and calculating a metric in two steps:
1) generate a grayscale difference image and threshold it:
convert img1.jpg img2.jpg -compose difference -composite gray -threshold 25% diff.jpg
2) get average intensity:
identify -format "%[mean]" diff.jpg
This gives me a single number that summarizes how different the two images are. My question is, is there a way to do this in a single command? And is there a way to do it w/o generating an image? I just want the number.
Thanks.
1) generate a grayscale difference image and threshold it:
convert img1.jpg img2.jpg -compose difference -composite gray -threshold 25% diff.jpg
2) get average intensity:
identify -format "%[mean]" diff.jpg
This gives me a single number that summarizes how different the two images are. My question is, is there a way to do this in a single command? And is there a way to do it w/o generating an image? I just want the number.
Thanks.