POV-Ray : Newsgroups : povray.pov4.discussion.general : Basic blur Server Time
28 Mar 2024 12:52:49 EDT (-0400)
  Basic blur (Message 1 to 9 of 9)  
From: IGM
Subject: Basic blur
Date: 21 Jan 2019 06:00:01
Message: <web.5c45a4517d2c77d6776fc67d0@news.povray.org>
Hi,
focal blur is a great feature, but on the ideal plane the blur is absent and the
image is perfectly sharp, and this is not realistic.
In real imaging, the camera has an intrinsic blur due to residual optical
aberrations, and perfectly sharp images can never be obtained at any focus
plane.

I know that povray, with photons, can reproduce real optical phenomena directly
linked to aberrations, as caustics, but it cannot emulate real optical
aberrations *in the image itself*. (Am I right?) A good example of optical
aberration easily seen in real images is coma:
https://upload.wikimedia.org/wikipedia/commons/thumb/8/8d/Baader_Rowe_Coma_Corrector_Comparison.jpg/300px-Baader_Rowe_C
oma_Corrector_Comparison.jpg.

Is there a way to apply a basic blur to the image without external apps, to
avoid the unrealistic sharpness of objects in the focal plane?

Thanks!
igmar


Post a reply to this message

From: IGM
Subject: Re: Basic blur
Date: 21 Jan 2019 06:15:00
Message: <web.5c45a8a2e22651a8776fc67d0@news.povray.org>
Sorry, my post was intended for the "General POV-Ray discussion"!!

igmar

"IGM" <iar### [at] gmailcom> wrote:
> Hi,
> ...


Post a reply to this message

From: ingo
Subject: Re: Basic blur
Date: 21 Jan 2019 07:03:09
Message: <XnsA9DE84C72527Dseed7@news.povray.org>
in news:web.5c45a4517d2c77d6776fc67d0@news.povray.org IGM wrote:

> Is there a way to apply a basic blur to the image without external
> apps, to avoid the unrealistic sharpness of objects in the focal
> plane? 
> 

You could try to greate a noise texture wit vey little ondulation, scale 
it down and use it as a normal for the camera,

follow up set to .general (I hope)

ingo


Post a reply to this message

From: Kenneth
Subject: Re: Basic blur
Date: 21 Jan 2019 07:55:01
Message: <web.5c45c0bee22651a8cd98345b0@news.povray.org>
Of the top of my head, I can imagine a two-step POV-Ray process that might work:

1) Render your scene the normal way (with antialiasing, to at least give a
preliminary smoothness.)

2) Bring that image (as an image_map) back into POV-Ray, apply it to a
correctly-sized box, and 're-photograph' it 1-to-1 using a focal_blue camera.
This way, the entire image can be slightly blurred, with the same amount of
blur. (A typical perspective camera is fine for that; it will not introduce
distortions like a real lens would.)

The only possible problem I can imagine *might* be that a focal_blur camera may
not give the expected results when looking at PIXELS in an image_map vs. real
scene geometry. I've never tried it, as far as I remember.


Post a reply to this message

From: Bald Eagle
Subject: Re: Basic blur
Date: 21 Jan 2019 10:10:00
Message: <web.5c45dffae22651a8765e06870@news.povray.org>
"IGM" <iar### [at] gmailcom> wrote:

> Is there a way to apply a basic blur to the image without external apps, to
> avoid the unrealistic sharpness of objects in the focal plane?

This is one of the things I was exploring with the Fourier transform.

Apparently "ALL" graphics packages accomplish many of their tasks using the
results of a 2D FFT.


Mathematically, applying a Gaussian blur to an image is the same as convolving
the image with a Gaussian function. This is also known as a two-dimensional
Weierstrass transform. By contrast, convolving by a circle (i.e., a circular box
blur) would more accurately reproduce the bokeh effect. Since the Fourier
transform of a Gaussian is another Gaussian, applying a Gaussian blur has the
effect of reducing the image's high-frequency components; a Gaussian blur is
thus a low pass filter.



So, you might be able to use that info for something, or come up with some other
clever method to fake it.

Things that come to mind are:

a thin clear sheet or lens in between the scene and the camera with an IOR > 1
a plane with some sort of AOI
a sheet or plane with a normal function

Taking a peek at:
https://docs.opencv.org/3.3.1/d4/d86/group__imgproc__filter.html#gaabe8c836e97159a9193fb0b11ac52cf1

you might be able to do what folks do to create a Voronoi diagram - use cones to
fill a space.
So, what I envision is "scanning" the rendered image with eval_pigment() and
placing a semi-transparent cone every 3rd POV unit to a achieve a blurring
effect
Perhaps add a function for the z-position so that the cones are higher the
farther away from the focal center.

Maybe something with concentric circles.


Obviously the clear sheet/lens would give you the smoothest result.
The rest are just things people might be inspired to fiddle with to create some
interesting and perhaps unexpected artistic effects.


Post a reply to this message

From: clipka
Subject: Re: Basic blur
Date: 21 Jan 2019 11:04:45
Message: <5c45ed9d$1@news.povray.org>
Am 21.01.2019 um 11:56 schrieb IGM:

> I know that povray, with photons, can reproduce real optical phenomena directly
> linked to aberrations, as caustics, but it cannot emulate real optical
> aberrations *in the image itself*. (Am I right?)

You can always do what you'd do with photons: Place an actual lens 
object in front of the camera.

> Is there a way to apply a basic blur to the image without external apps, to
> avoid the unrealistic sharpness of objects in the focal plane?

If you're just aiming to add some blur, the "camera normal" would indeed 
be the way to go, as already mentioned elsewhere.


Post a reply to this message

From: Kenneth
Subject: Re: Basic blur
Date: 22 Jan 2019 06:30:00
Message: <web.5c46fc62e22651a8cd98345b0@news.povray.org>
ingo <ing### [at] tagpovrayorg> wrote:

> You could try to greate a noise texture wit vey little ondulation, scale
> it down and use it as a normal for the camera,
>

and Clipka wrote:
> If you're just aiming to add some blur, the "camera normal" would indeed
> be the way to go...

Hey, that does work well:

camera{
......
......
normal{bumps 0.001 scale .0001}
}

Depending on the bump_size (the 0.001, vs. a larger value), the resulting image
*might* look a bit noisy-- but my own recourse would be to render the scene
with, say, 5 frames of an animation (no camera movement, but moving the bumps
pattern in  x via the clock, by some large random amount; then bring those
images back into POV-Ray and 'average' them together (using the'average'
pattern) and then re-photograph the result 1-to-1 for the *final* render. This
should help blend the noise.

Historically, when Hollywood used old-style rear-projection of scenes behind the
actors, the rear-projection screen was sometimes 'jiggled' when being
re-photographed, to 'smear' the inherent graininess of the screen(or to make the
graininess 'different' for each frame of the new photography.) Likewise in Ray
Harryhausen's stop-motion puppet-animation epics. It's the same principle here,
by averaging the POV renders.

Bald Eagle wrote:
> Things that come to mind are:
> a thin clear sheet or lens in between the scene and the camera,
> with an IOR > 1

I had earlier been toying with that idea as well. It works, but looks a bit TOO
grainy to my eyes. Plus, it has the effect of introducing more blur the farther
the scene's objects are from the sheet (kind of LIKE focal blur.) That was an
interesting surprise, but it makes sense.

(BTW, it was a bit difficult to find this 'normal' feature in the documentation,
as it's not under 'camera' in the in-built index, but rather
'perturbation/camera ray'. It's at "3.4.2.4 Camera Ray Perturbation" )


Post a reply to this message

From: clipka
Subject: Re: Basic blur
Date: 22 Jan 2019 09:00:28
Message: <5c4721fc$1@news.povray.org>
Am 22.01.2019 um 12:27 schrieb Kenneth:

> Depending on the bump_size (the 0.001, vs. a larger value), the resulting image
> *might* look a bit noisy-- but my own recourse would be to render the scene
> with, say, 5 frames of an animation (no camera movement, but moving the bumps
> pattern in  x via the clock, by some large random amount; then bring those
> images back into POV-Ray and 'average' them together (using the'average'
> pattern) and then re-photograph the result 1-to-1 for the *final* render. This
> should help blend the noise.

As I said, the new anti-aliasing mode 3 is your friend there: Just scale 
the bumps small enough, and it will take care of the rest, no extra work 
needed. It does this by randomly jittering the sample rays within the 
pixel, and adapting the number of samples to the variance it finds.


Post a reply to this message

From: Alain
Subject: Re: Basic blur
Date: 22 Jan 2019 12:05:14
Message: <5c474d4a$1@news.povray.org>
Le 19-01-22 à 09:00, clipka a écrit :
> Am 22.01.2019 um 12:27 schrieb Kenneth:
> 
>> Depending on the bump_size (the 0.001, vs. a larger value), the 
>> resulting image
>> *might* look a bit noisy-- but my own recourse would be to render the 
>> scene
>> with, say, 5 frames of an animation (no camera movement, but moving 
>> the bumps
>> pattern in  x via the clock, by some large random amount; then bring 
>> those
>> images back into POV-Ray and 'average' them together (using the'average'
>> pattern) and then re-photograph the result 1-to-1 for the *final* 
>> render. This
>> should help blend the noise.
> 
> As I said, the new anti-aliasing mode 3 is your friend there: Just scale 
> the bumps small enough, and it will take care of the rest, no extra work 
> needed. It does this by randomly jittering the sample rays within the 
> pixel, and adapting the number of samples to the variance it finds.


The anti-aliasing mode 2 may also be used here, but you need to increase 
the recursion level to 4 or 5 and reduce the threshold to 0.1 or less. 
The result won't be as good as with mode 3, but will probably be a 
little faster.

Another option is to use a small amount of focal blur. Make the aperture 
less than 1/1000 of the distance to the focal plane. This will force a 
fair amount of oversampling.


Post a reply to this message

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