getting a specific indicator on an image with imagemagick -
i'd evaluate if picture blurred or not. using imagemagick 6.7.7-10 i've seen identify commmand gives interesting information, , command:
identify -format "%[filename] sd:%[standard-deviation]\n" floue1.jpg
answer> floue1.jpg sd:7876.9
seems start. however, if use:
identify -verbose floue1.jpg | grep stan standard deviation: 34.8189 (0.136545) standard deviation: 26.7428 (0.104874) standard deviation: 29.8434 (0.117033) standard deviation: 30.6494 (0.120194)
i see 4 standard deviation values,one global , 1 each color channel, , these values differ single 1 got first command.
where these results come from/mean, , how can select (print) of these?
it works this:
identify -verbose floue1.jpg | grep stan standard deviation: 39.0047 (0.15296) standard deviation: 36.45 (0.142941) standard deviation: 37.9805 (0.148943) standard deviation: 37.8263 (0.148339)
the first number on line scaled on range 0-255 , second 1 normalised range of 0 1.
the first row red standard deviation, second green , third blue, whereas last averaged on channels.
if want access them individually, use:
convert floue1.jpg -format "%[filename] sd:%[fx:standard_deviation.blue]\n" info: floue1.jpg sd:0.148943
or, can select different 1 , scale too:
convert floue1.jpg -format "%[filename] sd:%[fx:int(standard_deviation.green*255)]\n" info: floue1.jpg sd:36
if want them in 1 go , using bash
, can do:
read sdr sdg sdb <<< $(convert floue1.jpg -format "%[fx:int(standard_deviation.red*255)] %[fx:int(standard_deviation.green*255)] %[fx:int(standard_deviation.blue*255)]" info: ) echo $sdr, $sdg, $sdb 39, 36, 37
Comments
Post a Comment