POV-Ray : Newsgroups : povray.newusers : Gaussian blur (PSF) Server Time
5 Nov 2024 11:19:10 EST (-0500)
  Gaussian blur (PSF) (Message 1 to 9 of 9)  
From: Omega
Subject: Gaussian blur (PSF)
Date: 18 Nov 2003 11:10:01
Message: <web.3fba444a555a70536b7c745d0@news.povray.org>
Hi all

Another question..

I used to generate images using a home-made C++ application, in which I was
able to simulate a Point-Spread-Function (doing a convolution with a square
kernel of a gaussian form).

In other words: when I was done constructing my image, all I needed to do is
to build a square kernel, say 5x5 pixels, filling it with a gaussian form.
Then, I applied this kernel to the image using convolution. This way, I
could achieve to simulate a blurring effect.

My question is, can PovRay do something like that? I thought of the
"focal_blur" keyword.. is it gaussian? is there a way to create our own
kernel?

Thanks!
O.


Post a reply to this message

From: Tim Nikias v2 0
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 11:48:33
Message: <3fba4d61$1@news.povray.org>
> My question is, can PovRay do something like that? I thought of the
> "focal_blur" keyword.. is it gaussian? is there a way to create our own
> kernel?

focal_blur is actually like a focal lense: some things will be in focus, and
some won't. This depends on the aperture value, and the overall quality
depends on several things: how close/far the objects are and how many
blur_samples you use. Gaussian-Blur, used for the entire image, can be
achieved with MegaPOV, if I'm not mistaken. But why would you want to blur
your image anyway?

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Email: tim.nikias (@) nolights.de


Post a reply to this message

From: Omega
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 12:50:01
Message: <web.3fba5aa51a62f81d6b7c745d0@news.povray.org>
Tim Nikias v2.0 wrote:
>focal_blur is actually like a focal lense: some things will be in focus, and
>some won't. This depends on the aperture value, and the overall quality
>depends on several things: how close/far the objects are and how many
>blur_samples you use. Gaussian-Blur, used for the entire image, can be
>achieved with MegaPOV, if I'm not mistaken. But why would you want to blur
>your image anyway?

Ok, I'll take a look on MegaPOV then.

>achieved with MegaPOV, if I'm not mistaken. But why would you want to blur
>your image anyway?

To simulate the PSF of a lens.

Thanks
O.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 14:12:32
Message: <cjameshuff-EF2BE6.14091818112003@netplex.aussie.org>
In article <web.3fba5aa51a62f81d6b7c745d0@news.povray.org>,
 "Omega" <nomail@nomail> wrote:

> >achieved with MegaPOV, if I'm not mistaken. But why would you want to blur
> >your image anyway?
> 
> To simulate the PSF of a lens.

With a 2D blur? In POV? Why?
A gaussian convolution blur won't be a very good approximation in the 
first place, and I'm really wondering why you would want to do it in 
POV, which although not designed for light simulation, has features that 
would allow much better approximations to be done...such as actually 
simulating the light traveling through the lens.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Omega
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 15:20:01
Message: <web.3fba7dec1a62f81d6b7c745d0@news.povray.org>
>> To simulate the PSF of a lens.
>
>With a 2D blur? In POV? Why?
>A gaussian convolution blur won't be a very good approximation in the
>first place, and I'm really wondering why you would want to do it in
>POV, which although not designed for light simulation, has features that
>would allow much better approximations to be done...such as actually
>simulating the light traveling through the lens.

From a previous post I made, I had the feeling PovRAY couldn't do the
simulating of the lens.. maybe I misunderstood ?

So, I'd be able to simulate the PSF of a lens using PovRay? How can I do
that?

Thanks for your help!
O.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 15:41:36
Message: <cjameshuff-8B9194.15382318112003@netplex.aussie.org>
In article <web.3fba7dec1a62f81d6b7c745d0@news.povray.org>,
 "Omega" <nomail@nomail> wrote:

> From a previous post I made, I had the feeling PovRAY couldn't do the
> simulating of the lens.. maybe I misunderstood ?

What previous post? I see a total of four threads started by you: the 
one about sinusoidal shadows, 16 bit output, normal patterns, and this 
thread.


> So, I'd be able to simulate the PSF of a lens using PovRay? How can I do
> that?

I'd start by shining a light through it using photons. However, this 
won't even come close to the same effect as blurring the image, so I 
wonder if it is what you are looking for...you really need to clearly 
state exactly what you are trying to accomplish.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Oldhand
Subject: Re: Gaussian blur (PSF)
Date: 18 Nov 2003 21:00:01
Message: <web.3fbacdb91a62f81d9e1a2890@news.povray.org>
Christopher James Huff wrote:
>In article <web.3fba7dec1a62f81d6b7c745d0[at]news.povray.org>,
> "Omega" <nomail[at]nomail> wrote:
>
>> From a previous post I made, I had the feeling PovRAY couldn't do the
>> simulating of the lens.. maybe I misunderstood ?
>
Sounds to me that what he's looking for is in a sample file included with
POVRay, in \scenes\camera\focal_blur.


Post a reply to this message

From: Omega
Subject: Re: Gaussian blur (PSF)
Date: 19 Nov 2003 08:55:01
Message: <web.3fbb761a1a62f81dd18b58c00@news.povray.org>
>What previous post? I see a total of four threads started by you: the
>one about sinusoidal shadows, 16 bit output, normal patterns, and this
>thread.

In the sinusoidal shadow one.. it was said that true diffraction effect
cannot be achieved by PovRay.. that's what made me thought that it can't be
done..

>I'd start by shining a light through it using photons. However, this
>won't even come close to the same effect as blurring the image, so I
>wonder if it is what you are looking for...you really need to clearly
>state exactly what you are trying to accomplish.

Ok..

What I'm trying to do is this:

I'm trying to simulate the lens effect that I can observe experimentally.

I grab pictures with a camera/lens assembly of a particular object. Since
the lens is not perfect, it has a transfer function, the point-spread
function (PSF) which causes high-intensity pixels to blur its surrounding
neighbors.

In order to revert the effect, it's been modeled as a convolution blur
(gaussian or more complex).

Since I'm trying to simulate reality, I'm trying fo find a way, in PovRay,
to generate this effect.

For now, I'm simulating the effect by doing a convolution with a
user-defined kernel on my "hand"-simulated images.

Since I'm relatively new to PovRay3.5, I don't really know how to do it.

Tell me if you need more info,
Thanks,
O.


Post a reply to this message

From: Christopher James Huff
Subject: Re: Gaussian blur (PSF)
Date: 21 Nov 2003 17:10:42
Message: <cjameshuff-43A0F4.17052421112003@netplex.aussie.org>
In article <web.3fbb761a1a62f81dd18b58c00@news.povray.org>,
 "Omega" <nomail@nomail> wrote:

> In the sinusoidal shadow one.. it was said that true diffraction effect
> cannot be achieved by PovRay.. that's what made me thought that it can't be
> done..

Right, diffraction can't be achieved. However, diffraction only accounts 
for a small part of point spreading.


> I grab pictures with a camera/lens assembly of a particular object. Since
> the lens is not perfect, it has a transfer function, the point-spread
> function (PSF) which causes high-intensity pixels to blur its surrounding
> neighbors.

Ok, this is "blooming", scattering/diffusion within the film or charge 
overflow in the CCD. This kind of scattering would be possible to 
simulate as a 2D convolution blur in the case of film, and a more 
complex blur for CCDs.

I'm pretty sure point spreading due to imperfect optics would require 
photon mapping with models of the actual optics, and is probably outside 
the capability of POV-Ray (unless you implement it as a POV script, in 
which case it will be very difficult and horribly slow and inefficient).


> Since I'm trying to simulate reality, I'm trying fo find a way, in PovRay,
> to generate this effect.
> 
> For now, I'm simulating the effect by doing a convolution with a
> user-defined kernel on my "hand"-simulated images.
> 
> Since I'm relatively new to PovRay3.5, I don't really know how to do it.

POV-Ray really isn't designed for this kind of image processing, but you 
can do something similar by loading the image as an image_map pigment, 
using functions to operate on each channel individually, and then using 
an average pigment with the channel functions to recombine them into one 
image. Alternatively, output in a form that POV-Ray's file I/O can read, 
and write a POV script that reads the image, processes it, and writes 
the blurred version out. You're really better off doing it in another 
program...

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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