Luminance - second lowest value

Hello,

I want to calculate the second lowest value of the luminance of a
picture in radiance.
I used the command pvalue –o –d –h –b –H picture.hdr | total –l |
rcalc –e ‘$1=$1*179’, to calculate the lowest value, but this gives me
the value zero. This is indeed the lowest value in my picture, but
therefor I'd like to get the second lowest value of the picture. Is
there an easy way to get this, or is the only way to get this value by
looking into the list of values for every pixel when I don't use the
total command?

Best regards,
Iris

Hi Iris,

The easiest method is to simply exclude values below a certain lower threshold:

  pvalue –o –d –h –b –H picture.hdr | rcalc –e ‘$1=$1*179’ -e 'cond=$1-1e-6' | total –l

The "cond" variable in rcalc suppresses any records where cond<=0. I have set the threshold here to 0.000001 watts/sr/m^2, but you can set it to whatever you like.

If you *really* want the second smallest value in a file, you can use the Unix sort command. The following should give you the 4 smallest values (ignoring duplicates):

  pvalue –o –d –h –b –H picture.hdr | rcalc –e ‘$1=$1*179’ | sort -g -u | head -4

Finally, there is the Radiance "histo" command, which can generate a histogram of values, instead:

  pvalue –o –d –h –b –H picture.hdr | rcalc –e ‘$1=log10($1*179)’ | histo -7 7

In the above example, I'm generating a histogram of 10-base log luminance values between 10^-7 and 10^7, and you can adjust this as desired.

Cheers,
-Greg

···

From: Iris Moonen <[email protected]>
Subject: [Radiance-general] Luminance - second lowest value
Date: December 4, 2015 4:14:47 PM GMT+01:00

Hello,

I want to calculate the second lowest value of the luminance of a
picture in radiance.
I used the command pvalue –o –d –h –b –H picture.hdr | total –l |
rcalc –e ‘$1=$1*179’, to calculate the lowest value, but this gives me
the value zero. This is indeed the lowest value in my picture, but
therefor I'd like to get the second lowest value of the picture. Is
there an easy way to get this, or is the only way to get this value by
looking into the list of values for every pixel when I don't use the
total command?

Best regards,
Iris