Page 1 of 1

Show only rmse statistics?

Posted: 2017-06-10T06:30:40-07:00
by pauledd
Hi

I use this command line to show some stats that I need from my images because I only need mean/min/max/std.dev and bit depth of all channels:
And I need rmse values only, not the one that goes from 0-1 or 0-255

Code: Select all

identify -verbose ../image.cr2 | grep 'min\|max\|mean\|deviation\|Red\|Green\|Blue\|Overall\|Gray
 Red: 16-bit
    Green: 16-bit
    Blue: 16-bit
    Red:
      min: 39987 (0.610163)
      max: 65535 (1)
      mean: 56933 (0.868743)
      standard deviation: 1790 (0.0273137)
    Green:
      min: 31874 (0.486366)
      max: 65535 (1)
      mean: 52995.1 (0.808654)
      standard deviation: 1429.62 (0.0218147)
    Blue:
      min: 51791 (0.79028)
      max: 65535 (1)
      mean: 65453 (0.998748)
      standard deviation: 565.024 (0.00862172)
    Overall:
      min: 31874 (0.486366)
      max: 65535 (1)
      mean: 58460.4 (0.892048)
      standard deviation: 5374.79 (0.0820141)
    dng:Green: 1.103
'
Is there a more elegant way to output this?

Re: Show only rmse statistics?

Posted: 2017-06-10T07:15:24-07:00
by snibgo
You can use "-format anything".

For "anything": %[fx:mean.r] gives mean in red channel, %[fx:standard_deviation.g] gives SD of green channel, etc.

RMSE is a measure of difference between two images, so what do you want for that?

Re: Show only rmse statistics?

Posted: 2017-06-10T08:59:24-07:00
by pauledd
With "%[fx:mean.r]" I get decimals from 0 to 1 but I need the integer values from 0 to 65535 (with 16bit images) as seen in the verbose output. I need this numbers because they are standart in astronomical software.

Re: Show only rmse statistics?

Posted: 2017-06-10T09:18:31-07:00
by pauledd
I found it: using "%[fx:65535*mean.r]" I get my desired number.

Re: Show only rmse statistics?

Posted: 2017-06-10T10:13:22-07:00
by fmw42
You can also do that with %[mean] after selecting the red channel. See http://www.imagemagick.org/script/escape.php %[fx: ... ] results in values between 0 and 1. %{statistic] gives values between 0 and quantumrange, where quantumrange depends upon your IM Q level. For Q16, the values will be 0 to 65535.

Re: Show only rmse statistics?

Posted: 2017-06-11T09:55:37-07:00
by pauledd
Is there also an "median" statistic available from identify? Modern astronomy application do have a median value.

Like here from PixInsight:
count (%) 100.00000
count (px) 18103008
mean 6688.487
median 7316.994
stdDev 1845.198
minimum 2133.722
maximum 10527.492

Re: Show only rmse statistics?

Posted: 2017-06-11T10:47:18-07:00
by snibgo
pauledd wrote:Is there also an "median" statistic available from identify?
No. Fred has a script for bash, which I think uses 256 bins. I have a Windows BAT script that uses the full Quantum of whatever IM you are using.

EDIT: I forgot, I also has a process module that sorts, so the median can be found in a single command.