PDA

View Full Version : Average luminance of the scene



Zengar
10-26-2003, 09:41 AM
Doing HRD rendering one should compute the average luminance value of the scene and then scale the image with respect of it. Fairly simple http://www.opengl.org/discussion_boards/ubb/smile.gif

What I don't understand, it's why shlould I compute my average like this:

1/pixelcount * exp(sum of ln(L(x, y))

Why log? Why not
1/pixelcount * sum of ln(L(x, y)

As far as I understand luminance is superpositionable value.

One more question: should I take RGB luminance values(one for each chanel) or should I compute the sum(= intencity)? Computing average for each color chanel would shift colors, wouldn't it?

zeckensack
10-26-2003, 02:50 PM
Both versions are kind of wrong as far as I can see.

Maybe the following was intended:
exp((sum of ln(L(x,y)))/pixelcount)
?

That would leave the issue that ln(0) is undefined, or, at best, -infinity. Not very nice for this application.

I can't judge whether or not a non-linear average is beneficial for exposure, as I have no hands on experience. However, if that's desired, a geometric mean (RMS*) is much safer than what you currently have. SMR* would be closer, and numerically safe, too.

I'd say you should try to get a linear mean implemented first. Once that's working, there's still time to play around with those other approaches.

*RMS <=> root of mean square: m=sqrt((sum of all(x))/n)
by SMR I mean the reverse: m=((sum of all(sqrt(x)))/n)


"One more question: should I take RGB luminance values(one for each chanel) or should I compute the sum(= intencity)? Computing average for each color chanel would shift colors, wouldn't it?"

Yup. Exposure (what you're simulating) doesn't do this in the real world, and thus you shouldn't do it. It wouldn't look real (might be an interesting 'special effect' though ...).

Zengar
10-26-2003, 02:54 PM
Thanks! Could you probably give me a link containing some usefull information. RMS would be most cheapes one btw.

Xmas
10-29-2003, 01:04 AM
Originally posted by Zengar:
One more question: should I take RGB luminance values(one for each chanel) or should I compute the sum(= intencity)? Computing average for each color chanel would shift colors, wouldn't it?
[/B]
You should use something like
L = 0.3 R + 0.59 G + 0.11 B