POV-Ray : Newsgroups : povray.advanced-users : Focal-Blur Insight questions... Server Time
1 Nov 2024 13:20:09 EDT (-0400)
  Focal-Blur Insight questions... (Message 1 to 4 of 4)  
From: Tim Nikias
Subject: Focal-Blur Insight questions...
Date: 14 Sep 2002 09:29:53
Message: <3d8339d1@news.povray.org>
I've just used a little focal-blur, and I'm just curious:
How exactly does POV calculate confidence and variance
values?

I'd expect POV to shoot rays for focal-blur, but what does
it actually do to judge if the pixel-color traced so far is
probably reaalllly close to the exact color? How can
POV be "confident" about that? I guess that variance,
telling in the docs that its a tolerance on "samples taken
so far", just tells POV: "See, the most recent samples all
look pretty much the same, lets stop tracing."
At least something similiar (probably it only compares
samples that went into a very similiar direction to see if
any additional samples would actually change the color
visibly)...

Well, I'm not too sure about all this, so anyone care to
explain to a curious user?

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


Post a reply to this message

From: Slime
Subject: Re: Focal-Blur Insight questions...
Date: 14 Sep 2002 12:31:25
Message: <3d83645d$1@news.povray.org>
> I've just used a little focal-blur, and I'm just curious:
> How exactly does POV calculate confidence and variance
> values?

Ever taken a class on statistics?

I did, but I forget too much to explain it here. It's interesting, though.

I believe it boils down to taking enough samples so that we are "x percent
confident that the variance from the true value caused by randomness is less
than y" with confidence x and variance y.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Charles Fusner
Subject: Re: Focal-Blur Insight questions...
Date: 16 Sep 2002 19:37:26
Message: <3D866B89.4020401@enter.net>
Tim Nikias wrote:
> I'd expect POV to shoot rays for focal-blur, but what does
> it actually do to judge if the pixel-color traced so far is
> probably reaalllly close to the exact color? How can
> POV be "confident" about that? I guess that variance,
> telling in the docs that its a tolerance on "samples taken
> so far", just tells POV: "See, the most recent samples all
> look pretty much the same, lets stop tracing."
> 

I only know some school book statistics, but based on that,
I'd say that's a pretty close guess. IIRC, the theory is
based on the idea that in a random sampling, the sum of all
samples tend to gravitate toward some mean value. That mean
itself will fluctate as more samples are taken, but will
tend to become increasingly fixed as a sufficiently
representative number of samples have been taken. I think
at this point, average variance from the mean is used to
determine what constitutes "sufficiently representative."

It's a good question, though, because I'm not clear why POV
needs both a variance and confidence keyword. I gathered that
[1.0 - confidence] yields the threshold below which average
variance must fall, I believe, to consititute "close enough."

My guess is that variance as used in POV terms will terminate the
sampling early if the confidence has *not* been reached, *but*
the variance is now so low anyway that it can't possibly contribute
to the pixel color (given the output bit depth). Sort of a double
adaptive method that offers the sampling two possible reasons to
stop to make absolutely sure no more samples are taken than
matter.

-- 
@C[$F];
The Silver Tome ::  http://www.silvertome.com
"You may sing to my cat if you like..."


Post a reply to this message

From: Retsam
Subject: Re: Focal-Blur Insight questions...
Date: 12 Mar 2003 19:55:07
Message: <web.3e6fd67e99f959c52a3ff2e70@news.povray.org>
Variance and confidence are two very diffferent things, at least in
statistics (not sure how POV calculates them, though I am going to check
the source code later).  Variance is related to standard deviation, and is
not dependent on the number of samples so much as it is dependent on the
sample set.  Think of it in terms of antialiasing, which is very similar to
focal blur in some ways.

If you have an image with a lot of detail, or with sharp edges, then a
single pixel, if viewed at infinite resolution, might contain reds, greens,
blues, yellows, etc.  This would result in a large variance.  Or it might
just contain shades of red, or subtly different shades of orange.  Then the
variance would be very low.  If the entire pixel contained one solid color,
then it would have a variance of 0.

The confidence is a function of the number of samples taken.  In a very
simple example, assume you flip a coin.  Every time you flip the coin, it
comes up heads.  After ten flips, you've still only gotten heads.  What's
your confidence that the coin is a double-headed coin, as opposed to a
normal head-tail coin?  In this case, the odds that a head-tail coin would
get ten straight heads is 1/1024, and the odds that a two-headed coin would
get ten straight heads is 1/1.  The ratio of those two probabilties gives a
confidence of just over 0.999.

Charles Fusner wrote:
>Tim Nikias wrote:
>> I'd expect POV to shoot rays for focal-blur, but what does
>> it actually do to judge if the pixel-color traced so far is
>> probably reaalllly close to the exact color? How can
>> POV be "confident" about that? I guess that variance,
>> telling in the docs that its a tolerance on "samples taken
>> so far", just tells POV: "See, the most recent samples all
>> look pretty much the same, lets stop tracing."
>>
>
>I only know some school book statistics, but based on that,
>I'd say that's a pretty close guess. IIRC, the theory is
>based on the idea that in a random sampling, the sum of all
>samples tend to gravitate toward some mean value. That mean
>itself will fluctate as more samples are taken, but will
>tend to become increasingly fixed as a sufficiently
>representative number of samples have been taken. I think
>at this point, average variance from the mean is used to
>determine what constitutes "sufficiently representative."
>
>It's a good question, though, because I'm not clear why POV
>needs both a variance and confidence keyword. I gathered that
>variance must fall, I believe, to consititute "close enough."
>
>My guess is that variance as used in POV terms will terminate the
>sampling early if the confidence has *not* been reached, *but*
>the variance is now so low anyway that it can't possibly contribute
>to the pixel color (given the output bit depth). Sort of a double
>adaptive method that offers the sampling two possible reasons to
>stop to make absolutely sure no more samples are taken than
>matter.
>
>@C[$F];
>The Silver Tome ::  http://www.silvertome.com
>"You may sing to my cat if you like..."
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.