POV-Ray : Newsgroups : povray.binaries.images : Re: Regarding the defocus module : Re: Regarding the defocus module Server Time
28 Apr 2024 01:33:32 EDT (-0400)
  Re: Regarding the defocus module  
From: clipka
Date: 4 Aug 2016 20:13:33
Message: <57a3da2d@news.povray.org>
Am 04.08.2016 um 18:59 schrieb clipka in povray.general:

>>> To compare this with a real camera lens, the camera location can be
>>> thought of as the center of the diaphragm (or, more precisely, the
>>> diaphragm's virtual image as seem through the lens), and the jittering
>>> of the rays accounts for the fact that the diaphragm's aperture is not
>>> infinitesimally small.
>>
>> I didn't really get this part. How would jittering account for the aperture
>> size? Would it be possible for you to explain this with the help of an image?
>> It would be really helpful.
> 
> I'll try to throw together something.

The attached image shows key elements of a real-life camera; from left
to right we can see:

- The "image plane", representing the camera's image recording element
(e.g. photographic film or CCD sensor).

- The "virtual aperture", representing the aperture's /apparent/
location and size when viewed through the lens.

- The "aperture", representing the primary limiting element in the beam
path (note that in real-life cameras this is usually the
variable-diameter opening of a diaphragm, /not/ the lens opening).

- The "lens", representing the optical assembly that focuses the light
onto the image recording element.

- A "plane out of focus", representing an arbitrary plane parallel to
the image plane that is currently not in focus.

- The "plane in focus", representing the plane parallel to the image
plane that is currently in focus.


To visualize what is happening in such a camera assembly, a few selected
points and light rays are shown:

- P represents an arbitrary point on the image plane, e.g. a grain on a
photographic film or a single pixel on a CCD sensor.

- The red, green and blue lines represent different selected light rays
that would all register at P. The red line represents the ray passing
right through the center of the aperture, while the green and blue lines
represent two rays traveling as far off the red ray as the aperture allows.

- P' represents the one and only point in space from which all three
light rays could originate. In fact, /any/ ray originating from this
point would inevitably register at P (provided they make it through the
aperture). As a result, P' would show up on the image at P as a single
crisp spot.

- P'1 and P'2 represent arbitrary alternate points from which the green
and blue rays, respectively, could originate. Note that in contrast to
P', /any other/ ray from these two points would inevitably register at a
point /different/ from P (again provided they make it through the
aperture at all). As a result, P'1 and P'2 would show up on the image as
big faint splotches, both covering (but not centered at) P.

- Q1 and Q2 represent the points at which the green and blue light rays,
respectively, pass through the aperture.

- Q1' and Q2' represent the points in the virtual aperture corresponding
to Q1 and Q2 in the actual aperture.


POV-Ray's focal blur mechanism can be thought of as follows:

(1) The nominal camera location always corresponds to the center of the
virtual aperture.

(2) From the camera settings, POV-Ray computes the parameters for a
simple pinhole camera equivalent, with the pinhole at the nominal camera
location.

(3) For a given point P in the image space, POV-Ray first uses the
simple pinhole model to compute the ray shown in red as originating from
the nominal camera location (= center of virtual aperture).

(4) POV-Ray now computes P' as the intersection of the red ray with the
plane in focus.

(5) POV-Ray now jitters the ray origin within the virtual aperture to
come up with a point Q'; for example, it might come up with point Q1' or
Q2'.

(6) POV-Ray computes a new ray, using Q' as the origin and (P'-Q') as
the direction. Note that this ray still travels through P'.

(7) POV-Ray traces the chosen ray; note that it might hit an object at
P', but it might just as well hit an object at P'1 if the origin was
Q1', or P'2 if the origin was Q2', or anywhere else along the ray in
question.

(8) POV-Ray sums up the result colour.

(9) POV-Ray repeats steps (5) to (8) a couple of times.

(10) From the sum of the result colours, POV-Ray computes the average,
and colours the pixel accordingly.

(11) POV-Ray proceeds to the next pixel, repeating steps (3) to (10).


I hope this helps understand what's going on with POV-Ray's focal blur.


Post a reply to this message


Attachments:
Download 'aperture.png' (92 KB)

Preview of image 'aperture.png'
aperture.png


 

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