POV-Ray : Newsgroups : povray.general : Focus Blur model Server Time: 16 Dec 2018 21:54:06 GMT
  Focus Blur model (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: CrisDamian
Subject: Focus Blur model
Date: 18 Jun 2018 10:05:01
Message: <web.5b27829cac8990aa601b3e010@news.povray.org>
I am trying to use a pair of datasets generated with POV-Ray(links below) in
order to test a depth from defocus cue algorithm but I know almost nothing about
POV-Ray and I can't figure out the parameters for the camera. What I need is:

- The aperture diameter of the camera (it says on the site that it is 40 but
that seems physically inaccurate).
- The focal length of the lens.
- The sampling period of the pixels.

I have experimented a bit with the dataset, the code is on:
https://github.com/CrisDamian/BlurEqualisationTechnique

There is also an issue on this:
https://github.com/CrisDamian/BlurEqualisationTechnique/issues/1

Datasets:
http://devernay.free.fr/vision/focus/patio/
http://devernay.free.fr/vision/focus/office/


Post a reply to this message

From: Alain
Subject: Re: Focus Blur model
Date: 18 Jun 2018 20:32:58
Message: <5b2816fa$1@news.povray.org>
Le 18-06-18 à 05:59, CrisDamian a écrit :
> 
> I am trying to use a pair of datasets generated with POV-Ray(links below) in
> order to test a depth from defocus cue algorithm but I know almost nothing about
> POV-Ray and I can't figure out the parameters for the camera. What I need is:
> 
> - The aperture diameter of the camera (it says on the site that it is 40 but
> that seems physically inaccurate).

That's NOT a diameter but that's about the horizontal field of view, in 
degree, of the default camera.

> - The focal length of the lens.
> - The sampling period of the pixels.
> 
> I have experimented a bit with the dataset, the code is on:
> https://github.com/CrisDamian/BlurEqualisationTechnique
> 
> There is also an issue on this:
> https://github.com/CrisDamian/BlurEqualisationTechnique/issues/1
> 
> Datasets:
> http://devernay.free.fr/vision/focus/patio/
> http://devernay.free.fr/vision/focus/office/
> 
> 

In POV-Ray, there is no real diameter for the camera and no real focal 
length. Unless defined otherwise, it's an ideal pinhole camera.

When you want to enable focal blur, you need to define an arbitrary 
aperture and set a focal point. The effective focal plane is 
perpendicular to the line going from the camera to the focal point. 
There is no concept of f stops.

The area of sharpness depend on the ratio between the aperture and the 
distance from the camera location to the focal point

Sample camera with focal blur :

camera{location -20*z
  up y // default
  direction z // default
  right 4/3*x // default if version <= 3.7
  aperture 0.25
  focal_point <0,0,0> // default
  blur_samples 100// maximum number of samples to take.
  confidence 0.99 //Must be less than 1
  variance 1/256 //must NOT be zero
}

This setup result in a camera that is close to a camera at f80 with an 
horizontal field of view of about 40°.
The samples are taken in a roughly circular pattern.
You can set a minimum number of samples by using two values for 
blur_samples :
blur_samples 12, 100
The samples are simply averaged to get the final value for the current 
pixel been rendered.


Post a reply to this message

From: William F Pokorny
Subject: Re: Focus Blur model
Date: 18 Jun 2018 23:04:20
Message: <5b283a74$1@news.povray.org>
On 06/18/2018 05:59 AM, CrisDamian wrote:
> 
> I am trying to use a pair of datasets generated with POV-Ray(links below) in
> order to test a depth from defocus cue algorithm but I know almost nothing about
> POV-Ray and I can't figure out the parameters for the camera. What I need is:
> 
> - The aperture diameter of the camera (it says on the site that it is 40 but
> that seems physically inaccurate).
> - The focal length of the lens.
> - The sampling period of the pixels.
> 
> 

Edouard Poor posted a "35mm Camera Macro" package back in 2009 which 
might be of some help.

http://news.povray.org/povray.binaries.images/thread/%3C49c0b1af%241%40news.povray.org%3E/

Bill P.


Post a reply to this message

From: CrisDamian
Subject: Re: Focus Blur model
Date: 19 Jun 2018 07:20:01
Message: <web.5b28ad704ad23916601b3e010@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> In POV-Ray, there is no real diameter for the camera and no real focal
> length. Unless defined otherwise, it's an ideal pinhole camera.
>
> When you want to enable focal blur, you need to define an arbitrary
> aperture and set a focal point. The effective focal plane is
> perpendicular to the line going from the camera to the focal point.
> There is no concept of f stops.
>
> The area of sharpness depend on the ratio between the aperture and the
> distance from the camera location to the focal point
>
> Sample camera with focal blur :
>
> camera{location -20*z
>   up y // default
>   direction z // default
>   right 4/3*x // default if version <= 3.7
>   aperture 0.25
>   focal_point <0,0,0> // default
>   blur_samples 100// maximum number of samples to take.
>   confidence 0.99 //Must be less than 1
>   variance 1/256 //must NOT be zero
> }
>
> This setup result in a camera that is close to a camera at f80 with an
> horizontal field of view of about 40°.
> The samples are taken in a roughly circular pattern.
> You can set a minimum number of samples by using two values for
> blur_samples :
> blur_samples 12, 100
> The samples are simply averaged to get the final value for the current
> pixel been rendered.

I have found an attached `patio_stereo_near2.pov` file with something like this:

    camera{
      location cam_pos+half_interocular*dir_right*(clock*2-1)
      direction
cam_dir-vlength(cam_dir)*dir_right*half_interocular/convergence_dist*(clock*2-1)
      up        cam_up
      right     cam_right
      focal_point fountain_pos
      aperture 10     // twice much blurring
      blur_samples 800      // many samples, high quality image
      variance 0. // 0001 // see pov-ray soc on focal blur
    }

So it means that the focal plane is perpendicular to `direction` and goes
through `focal_point`.
My goal is to find the diameter of the point spread function (also called the
circle of confusion https://en.wikipedia.org/wiki/Circle_of_confusion) with
respect to depth.


Post a reply to this message

From: clipka
Subject: Re: Focus Blur model
Date: 19 Jun 2018 09:12:24
Message: <5b28c8f8$1@news.povray.org>
Am 19.06.2018 um 09:14 schrieb CrisDamian:
> Alain <kua### [at] videotronca> wrote:
>> In POV-Ray, there is no real diameter for the camera and no real focal
>> length. Unless defined otherwise, it's an ideal pinhole camera.
>>
>> When you want to enable focal blur, you need to define an arbitrary
>> aperture and set a focal point. The effective focal plane is
>> perpendicular to the line going from the camera to the focal point.
>> There is no concept of f stops.
>>
>> The area of sharpness depend on the ratio between the aperture and the
>> distance from the camera location to the focal point
>>
>> Sample camera with focal blur :
>>
>> camera{location -20*z
>>   up y // default
>>   direction z // default
>>   right 4/3*x // default if version <= 3.7
>>   aperture 0.25
>>   focal_point <0,0,0> // default
>>   blur_samples 100// maximum number of samples to take.
>>   confidence 0.99 //Must be less than 1
>>   variance 1/256 //must NOT be zero
>> }
>>
>> This setup result in a camera that is close to a camera at f80 with an
>> horizontal field of view of about 40ð.
>> The samples are taken in a roughly circular pattern.
>> You can set a minimum number of samples by using two values for
>> blur_samples :
>> blur_samples 12, 100
>> The samples are simply averaged to get the final value for the current
>> pixel been rendered.
> 
> I have found an attached `patio_stereo_near2.pov` file with something like this:
> 
>     camera{
>       location cam_pos+half_interocular*dir_right*(clock*2-1)
>       direction
> cam_dir-vlength(cam_dir)*dir_right*half_interocular/convergence_dist*(clock*2-1)
>       up        cam_up
>       right     cam_right
>       focal_point fountain_pos
>       aperture 10     // twice much blurring
>       blur_samples 800      // many samples, high quality image
>       variance 0. // 0001 // see pov-ray soc on focal blur
>     }
> 
> So it means that the focal plane is perpendicular to `direction` and goes
> through `focal_point`.
> My goal is to find the diameter of the point spread function (also called the
> circle of confusion https://en.wikipedia.org/wiki/Circle_of_confusion) with
> respect to depth.

Near the image center, POV-Ray's focal blur model approaches that of an
idealized thin lens, with an idealized aperture placed right in the lens
plane:

The `location` vector specifies the center of the lens within the scene,
in scene units.

The `direction` vector specifies the direction of the optical axis. Its
length is only relevant with respect to the `up` and `right` vectors,
and only if no `angle` parameter is specified.

The `up` and `right` vectors specify the orientation of the camera
sensor; the ratio of their lengths also specifies the "physical" aspect
ratio.

In the absence of an `angle` parameter, the ratio between the lengths of
the `direction` and `right` vectors also governs the horizontal angle of
view. Presuming orthogonal vectors, the angle is
alpha=2*atan(|right|/|direction|).

The `focal_point` vector's length, in scene units, specifies the
distance along the optical axis at which an object would be in full
focus; the vector's direction is actually ignored.

The `aperture` setting specifies the size of the camera aperture in
scene units.


Further from the image center, POV-Ray's focal blur model becomes
increasingly non-realistic: Rather than a plane of focus, POV-Ray's
focal blur model actually has a sphere of focus, and the aperture is
also modeled to have spherical symmetry.


Post a reply to this message

From: clipka
Subject: Re: Focus Blur model
Date: 19 Jun 2018 09:26:19
Message: <5b28cc3b$1@news.povray.org>
Am 19.06.2018 um 11:12 schrieb clipka:

> The `aperture` setting specifies the size of the camera aperture in
> scene units.

I'm just realizing that this statement is ambiguous. Strike "size" and
substitute "diameter".


> Further from the image center, POV-Ray's focal blur model becomes
> increasingly non-realistic: Rather than a plane of focus, POV-Ray's
> focal blur model actually has a sphere of focus, and the aperture is
> also modeled to have spherical symmetry.

Strike that entire paragraph; I was misinterpreting the source code.

The surface of focus is a plane perpendicular to the `direction` vector,
and the aperture is modeled to be circular, in a plane also
perpendicular to the `direction` vector [for the sake of focal blur;
POV-Ray does not account for the reduction in luminous intensity this
model would normally imply at high angles].


Post a reply to this message

From: Mr
Subject: Re: Focus Blur model
Date: 26 Jun 2018 14:35:01
Message: <web.5b324e4b4ad2391616086ed00@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 06/18/2018 05:59 AM, CrisDamian wrote:
> >
> > I am trying to use a pair of datasets generated with POV-Ray(links below) in
> > order to test a depth from defocus cue algorithm but I know almost nothing about
> > POV-Ray and I can't figure out the parameters for the camera. What I need is:
> >
> > - The aperture diameter of the camera (it says on the site that it is 40 but
> > that seems physically inaccurate).
> > - The focal length of the lens.
> > - The sampling period of the pixels.
> >
> >
>
> Edouard Poor posted a "35mm Camera Macro" package back in 2009 which
> might be of some help.
>
>
http://news.povray.org/povray.binaries.images/thread/%3C49c0b1af%241%40news.povray.org%3E/
>
> Bill P.
Sorry,
I could not find this in povray.binaries.scenes,

Could anyone explain to me why POV-Ray binary scenes and povray images are
separated in the newsgroups? I feel it makes things so tedious every time! I
thought there were only advantages to have no POV forum and only mail
newsgroups... I probably am using them wrong?

Also to be back on topic, couldn't this 35 mm macro be integrated in the
official list of POV/UberPOV macros if it still works? Thanks for all the
information already brought up so far.


Post a reply to this message

From: Stephen
Subject: Re: Focus Blur model
Date: 26 Jun 2018 15:08:09
Message: <5b3256d9$1@news.povray.org>
On 26/06/2018 15:31, Mr wrote:
> Sorry,
> I could not find this in povray.binaries.scenes,

I found it. The date it was posted is 16/03/2009
I replied to it to bump the post. I also downloaded the macro if you 
can't find it.

-- 

Regards
     Stephen


Post a reply to this message

From: Bald Eagle
Subject: Re: Focus Blur model
Date: 26 Jun 2018 19:15:01
Message: <web.5b3290164ad23916c437ac910@news.povray.org>
"Mr" <mauriceraybaud [at] hotmail dot fr>> wrote:

> Sorry,
> I could not find this in povray.binaries.scenes,
>
> Could anyone explain to me why POV-Ray binary scenes and povray images are
> separated in the newsgroups? I feel it makes things so tedious every time! I
> thought there were only advantages to have no POV forum and only mail
> newsgroups... I probably am using them wrong?

Well, the povray.binaries.scenes (pbs) section is usually for posting the actual
scene file(s) that may be in a binary format, such as a zipped directory
including the .pov text file, mesh include files, image files necessary for
running the scene (image maps, heightfields, etc)

The povray.binaries.images (pbi) section is for posting the actual rendered
images for people to look at, comment on, and enjoy.  Some folks hold the inner
working of their scenes as closely guarded secrets  ;)


> Also to be back on topic, couldn't this 35 mm macro be integrated in the
> official list of POV/UberPOV macros if it still works? Thanks for all the
> information already brought up so far.

Management of things like that is an arduous and largely thankless task.  I'm
sure you could start an indexed repository of macros and other scene code
(hopefully with date or version information :) ) just to see what I mean.

A nice zip file to add to the insert menu would be a beautiful thing as well.

There's just SO MUCH, and it's not used all the time, and even just the stuff
that's IN POV-Ray and documented to the amazing extent that it is, is nearly
impossible to keep track of.

And then there's the time and energy to bring it to fruition...

Just throwing that all out there for your consideration - it's not as trivial as
we all wish it was.


Post a reply to this message

From: William F Pokorny
Subject: Re: Focus Blur model
Date: 27 Jun 2018 13:46:19
Message: <5b33952b$1@news.povray.org>
On 06/26/2018 10:31 AM, Mr wrote:
> William F Pokorny <ano### [at] anonymousorg> wrote:
> 
> Could anyone explain to me why POV-Ray binary scenes and povray images are
> separated in the newsgroups? I feel it makes things so tedious every time! 
...
> 

http://news.povray.org/povray.binaries.scene-files/thread/%3C5b325680%241%40news.povray.org%3E/

(Thanks for making the link easier to find Stephen)

I believe it the case that in the olden days of dial-up Internet and 
slow data transfers, the separation of uploaded data and discussion made 
sense. Why too there is the practice of posting binary images apart from 
discussions which might happen in other newsgroups. I agree it's today 
cumbersome.

Bill P.


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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