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.
How to convert and get a metric in one command?
Re: How to convert and get a metric in one command?
I got it!
convert img1.jpg img2.jpg -compose difference -composite gray -threshold 25% -format "%[mean]" info:
Phew. Sorry to take up space here.
convert img1.jpg img2.jpg -compose difference -composite gray -threshold 25% -format "%[mean]" info:
Phew. Sorry to take up space here.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to convert and get a metric in one command?
For other notes and methods for getting various image metrics for compareing lots and lots of images, look at IM Examples Metrics.
http://imagemagick.org/Usage/compare/
I have been struggling to find ways of finding matching or simular images of various sorts and thes notes represent my struggles.
http://imagemagick.org/Usage/compare/
I have been struggling to find ways of finding matching or simular images of various sorts and thes notes represent my struggles.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/