# Excluding zeroed values from averaged luminance

Hi Everyone,

I have a masked HDR picture generated by combining the original HDR with a
mask one. I want to calculate average luminance value of the masked HDR
picture without taking zeroed values into account. I am using ‘pvalue –o –d
–h –b –H masked.hdr | rcalc –e if’cond=\$1-5;\$1=\$1’| total –m’. But the ‘if
condition’ is not working. Your help is very much appreciated.

Cheers,

Parisa

Hi Parisa,

pvalue –o –d –h –b –H masked.hdr | rcalc –e ’cond=\$1-5;\$1=\$1’ | total –m

You had an extra 'if' in there, which was concatenated with the "cond" variable to turn it into "ifcond", which rcalc ignored. The variable needs to be "cond" for it to work. This will include all values greater than 5.0 in the average. You may wish to adjust this value downwards if you don't want to miss small details.

Best,
-Greg

···

Date: December 9, 2016 7:59:01 AM PST

Hi Everyone,

I have a masked HDR picture generated by combining the original HDR with a mask one. I want to calculate average luminance value of the masked HDR picture without taking zeroed values into account. I am using ‘pvalue –o –d –h –b –H masked.hdr | rcalc –e if’cond=\$1-5;\$1=\$1’| total –m’. But the ‘if condition’ is not working. Your help is very much appreciated.

Cheers,

Parisa

Hi Parisa,
I was just about to answer but Greg was faster... (and his command is also more elegant than the one I would have suggested...)

One short comment to the method: if you compare this value with the output of evalglare in masking mode, then you might get a different value. The reason for this is that with your command you calculate the average luminance of the masked pixels and not the average luminance of the masking area... evalglare weights the luminance by the solid angle of each pixel to get the average in an area. Depending on your projection method you get therefore then different results. I can remember there were also some posts before how to weight by solid angle using radiance commands.
best
Jan

···

On 9 December 2016 17:27:46 CET, Greg Ward <[email protected]> wrote:

Hi Parisa,

pvalue –o –d –h –b –H masked.hdr | rcalc –e ’cond=\$1-5;\$1=\$1’ | total
–m

You had an extra 'if' in there, which was concatenated with the "cond"
variable to turn it into "ifcond", which rcalc ignored. The variable
needs to be "cond" for it to work. This will include all values
greater than 5.0 in the average. You may wish to adjust this value
downwards if you don't want to miss small details.

Best,
-Greg

Date: December 9, 2016 7:59:01 AM PST

Hi Everyone,

I have a masked HDR picture generated by combining the original HDR

with a mask one. I want to calculate average luminance value of the
masked HDR picture without taking zeroed values into account. I am
using ‘pvalue –o –d –h –b –H masked.hdr | rcalc –e if’cond=\$1-5;\$1=\$1’|
total –m’. But the ‘if condition’ is not working. Your help is very
much appreciated.

Cheers,

Parisa

------------------------------------------------------------------------

_______________________________________________
[email protected]

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Hi Greg,

Thank you so much! I have tried 100 other possibilities but all with if & cond together!!!

Cheers,
Parisa

···

On Dec 9, 2016, at 5:27 PM, Greg Ward <[email protected]> wrote:

Hi Parisa,

pvalue –o –d –h –b –H masked.hdr | rcalc –e ’cond=\$1-5;\$1=\$1’ | total –m

You had an extra 'if' in there, which was concatenated with the "cond" variable to turn it into "ifcond", which rcalc ignored. The variable needs to be "cond" for it to work. This will include all values greater than 5.0 in the average. You may wish to adjust this value downwards if you don't want to miss small details.

Best,
-Greg

From: parisa khademagha <[email protected] <mailto:[email protected]>>
Date: December 9, 2016 7:59:01 AM PST

Hi Everyone,

I have a masked HDR picture generated by combining the original HDR with a mask one. I want to calculate average luminance value of the masked HDR picture without taking zeroed values into account. I am using ‘pvalue –o –d –h –b –H masked.hdr | rcalc –e if’cond=\$1-5;\$1=\$1’| total –m’. But the ‘if condition’ is not working. Your help is very much appreciated.

Cheers,

Parisa

_______________________________________________
[email protected]

Hi Jan,

Thanks for the reply! I realized that evalglare for averaging luminance takes the solid angle of each pixel into account, that is why I looked for a basic way of using masks and calculating average luminance for now and I will get back to the evalglare later. The new features are very interesting!

Cheers,
Parisa

···

On Dec 9, 2016, at 8:39 PM, Jan Wienold <[email protected]> wrote:

Hi Parisa,
I was just about to answer but Greg was faster... (and his command is also more elegant than the one I would have suggested...)

One short comment to the method: if you compare this value with the output of evalglare in masking mode, then you might get a different value. The reason for this is that with your command you calculate the average luminance of the masked pixels and not the average luminance of the masking area... evalglare weights the luminance by the solid angle of each pixel to get the average in an area. Depending on your projection method you get therefore then different results. I can remember there were also some posts before how to weight by solid angle using radiance commands.
best
Jan

On 9 December 2016 17:27:46 CET, Greg Ward <[email protected]> wrote:
>Hi Parisa,
>
>
> pvalue –o –d –h –b –H masked.hdr | rcalc –e ’cond=\$1-5;\$1=\$1’ | total
>–m
>
>You had an extra 'if' in there, which was concatenated with the "cond"
>variable to turn it into "ifcond", which rcalc ignored. The variable
>needs to be "cond" for it to work. This will include all values
>greater than 5.0 in the average. You may wish to adjust this value
>downwards if you don't want to miss small details.
>
>Best,
>-Greg
>
>> From: parisa khademagha <[email protected]>
>> Date: December 9, 2016 7:59:01 AM PST
>>
>> Hi Everyone,
>>
>>
>>
>> I have a masked HDR picture generated by combining the original HDR
>with a mask one. I want to calculate average luminance value of the
>masked HDR picture without taking zeroed values into account. I am
>using ‘pvalue –o –d –h –b –H masked.hdr | rcalc –e if’cond=\$1-5;\$1=\$1’|
>total –m’. But the ‘if condition’ is not working. Your help is very
>much appreciated.
>>
>>
>>
>> Cheers,
>>
>> Parisa
>>
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________