POV-Ray : Newsgroups : povray.newusers : Simulate a camera with no lens Server Time
23 Nov 2024 23:52:18 EST (-0500)
  Simulate a camera with no lens (Message 1 to 7 of 7)  
From: Crippso
Subject: Simulate a camera with no lens
Date: 26 May 2011 18:20:00
Message: <web.4dded11b6317d989bf90049a0@news.povray.org>
Hi,

I've only just downloaded pov-ray so sorry if this is a really stupid
question...

I understand that the camera model in pov-ray is that of an ideal pin hole
camera, and that the field of view of the camera is set which essentially
defines the properties of the 'lens' in front of the camera.

What I'd really like to be able to do is model what a focal plane array (FPA)
would see when a camera has no lens to focus the rays. In this 'no-lens'
scenario I'd like to define an approximate field of view by placing the FPA at
the back face of a cylinder, with an aperture in the front face.

Is this possible in pov-ray?

any thoughts/advice greatly appreciated!

Stu


Post a reply to this message

From: Alain
Subject: Re: Simulate a camera with no lens
Date: 26 May 2011 20:33:57
Message: <4ddef175$1@news.povray.org>

> Hi,
>
> I've only just downloaded pov-ray so sorry if this is a really stupid
> question...
>
> I understand that the camera model in pov-ray is that of an ideal pin hole
> camera, and that the field of view of the camera is set which essentially
> defines the properties of the 'lens' in front of the camera.
>
> What I'd really like to be able to do is model what a focal plane array (FPA)
> would see when a camera has no lens to focus the rays. In this 'no-lens'
> scenario I'd like to define an approximate field of view by placing the FPA at
> the back face of a cylinder, with an aperture in the front face.
>
> Is this possible in pov-ray?
>
> any thoughts/advice greatly appreciated!
>
> Stu
>
>

Having no lense can be approximated by a focal point placed extremely close.

A possibility:
Use focal blur with a focal plane very close to the camera location. 
Keep the aperture relatively small.

Sample camera:
camera{location Cam_Location look_at Subject aperture 0.01 focal_point 
Cam_Location + (Cam_Location - Subject)/100 blur_samples 10, 200}

Try this and compare with a real photography taken without any lense to 
see if it's going the right way.
Adjust aperture as you see fit.

If you place an open cylinder in front of the camera, it's radius is the 
upper limit for your aperture. Otherwize, you'll get some samples taken 
outside of it.



Alain


Post a reply to this message

From: clipka
Subject: Re: Simulate a camera with no lens
Date: 26 May 2011 21:01:10
Message: <4ddef7d6$1@news.povray.org>
Am 27.05.2011 00:15, schrieb Crippso:
> Hi,
>
> I've only just downloaded pov-ray so sorry if this is a really stupid
> question...
>
> I understand that the camera model in pov-ray is that of an ideal pin hole
> camera, and that the field of view of the camera is set which essentially
> defines the properties of the 'lens' in front of the camera.
>
> What I'd really like to be able to do is model what a focal plane array (FPA)
> would see when a camera has no lens to focus the rays. In this 'no-lens'
> scenario I'd like to define an approximate field of view by placing the FPA at
> the back face of a cylinder, with an aperture in the front face.
>
> Is this possible in pov-ray?

Possibly the most realistic way to model this would be as follows:

- Build your "camera" using scene geometry, including a placeholder 
dummy for the FPA, which should be a plain white diffuse slab (pigment { 
rgb 1.0 } finish { ambient 0 diffuse 1.0 specular 0 }).

- Turn on radiosity (you may need very high-quality settings, especially 
a high "count" value). This will effectively project the scene onto the 
FPA dummy slab (very blurry).

- Use an orthographic camera placed just a tiny bit in front of the FPA 
dummy, oriented to look at the FPA dummy, to capture the pattern of 
light projected onto the dummy. (Note that you may actually get a 
mirrored image.)


Post a reply to this message

From: Crippso
Subject: Re: Simulate a camera with no lens
Date: 1 Jun 2011 18:45:01
Message: <web.4de6c03377af101ebf90049a0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 27.05.2011 00:15, schrieb Crippso:
> > Hi,
> >
> > I've only just downloaded pov-ray so sorry if this is a really stupid
> > question...
> >
> > I understand that the camera model in pov-ray is that of an ideal pin hole
> > camera, and that the field of view of the camera is set which essentially
> > defines the properties of the 'lens' in front of the camera.
> >
> > What I'd really like to be able to do is model what a focal plane array (FPA)
> > would see when a camera has no lens to focus the rays. In this 'no-lens'
> > scenario I'd like to define an approximate field of view by placing the FPA at
> > the back face of a cylinder, with an aperture in the front face.
> >
> > Is this possible in pov-ray?
>
> Possibly the most realistic way to model this would be as follows:
>
> - Build your "camera" using scene geometry, including a placeholder
> dummy for the FPA, which should be a plain white diffuse slab (pigment {
> rgb 1.0 } finish { ambient 0 diffuse 1.0 specular 0 }).
>
> - Turn on radiosity (you may need very high-quality settings, especially
> a high "count" value). This will effectively project the scene onto the
> FPA dummy slab (very blurry).
>
> - Use an orthographic camera placed just a tiny bit in front of the FPA
> dummy, oriented to look at the FPA dummy, to capture the pattern of
> light projected onto the dummy. (Note that you may actually get a
> mirrored image.)

Thanks, thats very helpful. I've given it a try and am getting some good results
by playing around with the radiosity settings.

I'd like to place a flat disc in front of my FPA that is acting as a lambertian
emitter. The FPA will see part of this emitter through the aperture in the
cylinder. Is it possible to include such surfaces in povray by setting their
ambient value to a number representing the radiance of the surface?

Much advice on radiosity suggests ambient should always be set to zero so I
wasn't sure if using ambient was a good way of generating a lambertian emitter
when using radiosity.

Ultimately I would like to be able to use the pixel values I obtain when looking
at the diffuse slab that represents the FPA and convert these to Watts (or
photons per second) based on the amount of light emission from the flat disc.
Any advice on the best way to acheive this would be very helpful too (I have
already set gamma to 1.0)

Thanks
Stuart


Post a reply to this message

From: clipka
Subject: Re: Simulate a camera with no lens
Date: 2 Jun 2011 05:56:56
Message: <4de75e68@news.povray.org>
Am 02.06.2011 00:41, schrieb Crippso:

> I'd like to place a flat disc in front of my FPA that is acting as a lambertian
> emitter. The FPA will see part of this emitter through the aperture in the
> cylinder. Is it possible to include such surfaces in povray by setting their
> ambient value to a number representing the radiance of the surface?

As of POV-Ray 3.7, Lambertian emission is officially supported via the 
"emission" finish term. As to be expected, a value of 1.0 corresponds to 
the same brightness as an ideal Lambertian reflector illuminated 
vertically by a light source of unity brightness.

With POV-Ray 3.6x or earlier, the same effect can indeed be emulated via 
the "ambient" finish term; however, the value must be divided by 
whatever the global value "ambient_light" is set to (which defaults to 
1.0). Obviously, you'll need a non-zero ambient_light value for this to 
work.

> Much advice on radiosity suggests ambient should always be set to zero so I
> wasn't sure if using ambient was a good way of generating a lambertian emitter
> when using radiosity.

My suggestion in that respect is to use POV-Ray 3.7 and use the 
"emission" finish term.

If for some reason you are stuck with POV-Ray 3.6x or earlier, a 
feasible workaround is to set ambient_light to some very low value (such 
as 0.001), and increase the ambient finish term accordingly (e.g. 
1000.0) to compensate.

> Ultimately I would like to be able to use the pixel values I obtain when looking
> at the diffuse slab that represents the FPA and convert these to Watts (or
> photons per second) based on the amount of light emission from the flat disc.
> Any advice on the best way to acheive this would be very helpful too (I have
> already set gamma to 1.0)

POV-Ray doesn't prescribe a particular unit of measurement for 
brightness, so you could define an "emission" finish setting of 1.0 to 
correspond to a Lambertian emission of 1.0 Watts per square unit. In 
that case, a 100% white pixel value would correspond to a light input to 
the sensor of 1.0 Watts per square unit (provided it doesn't happen to 
be clipped of course).

As for gamma, be sure to set both the assumed_gamma global setting in 
the scene file as well as File_Gamma in the INI file to 1.0 for your 
purposes. I recommend PNG output (as it can still be viewed accurately 
with contemporary sotware, despite the linear gamma settings) or, even 
better yet, HDR or OpenEXR (as they prevent clipping and are linear 
anyway). The latter two require POV-Ray 3.7.


Post a reply to this message

From: Crippso
Subject: Re: Simulate a camera with no lens
Date: 8 Jun 2011 17:40:00
Message: <web.4defebe177af101ebf90049a0@news.povray.org>
Thanks,

I've installed v3.7 and the emission term works nicely. Thanks for the advice
too about setting the file gamma to 1.

The only thing I'm struggling with now are the radiosity settings. At first I
had quite blotchy images but I've played around with the settings a bit and have
got a pretty smooth output now. However the brightness across the image is not
perfectly symmetric as it should be. (I'm using Scilab to open up my 16 bit png
files so i can inspect the rgb values carefully)

If anyone has advice on what the problem might be that would be great. I have
attached my code below:

Thanks

Stuart

#local p_start  = 64/image_width;
#local p_end_tune = 8/image_width;
#local p_end_final = 8/image_width;


#local final_eb  = 1.8;
#local final_count = 1600;

global_settings{

assumed_gamma 1.0



radiosity
{
    pretrace_start p_start
    pretrace_end   p_end_final


    count final_count
    low_error_factor .05

    nearest_count 20

    error_bound final_eb


    recursion_limit 1

    minimum_reuse 0.01
    gray_threshold 0.0
    normal on
    }
}


#include "colors.inc"
#include "textures.inc"

#declare h=20; // cylinder height
#declare d=10; // aperture diameter
#declare R=200; // distance of emitting disc to focal plane array (FPA)
#declare ahor=12.8; // width of FPA
#declare aver=ahor/1.33; // height of FPA
#declare e=2; // distance from edge of array to cylinder edge
#declare c=ahor+2*e; // diameter of cylinder
#declare m=(R/(2*h))*(d+ahor)+ahor/2; //radius of emitting disc
#declare p=h/2; // position of camera in front of array
#declare FoVortho =  degrees(2*atan(ahor/(2*p)));       // FoV of orthographic
cam used to view FPA

#declare radianceScene = 5;  // brightness (radiance) of emitting disc
#declare radianceRS = 0;  // brightness (radiance) of emitting cylinder


camera {orthographic location <0,0,p> look_at <0,0,0> angle FoVortho*1.0}

// diffuse slab representing FPA (set no_radiosity with the intention that
reflected rays do not
// get used in the radiosity calculation)
polygon {
    5,
    <-ahor/2,-aver/2,0>, <ahor/2,-aver/2,0>, <ahor/2,aver/2,0>,
<-ahor/2,aver/2,0>, <-ahor/2,-aver/2,0>
    texture {
      finish { emission 0 ambient 0 diffuse 1 specular 0 conserve_energy}
pigment {color rgb<1,1,1>}
    }
    scale 1.0 rotate <0,0,0> no_radiosity
  }

// emitting disc
disc {<0,0,0>,<0,0,2>, m, rotate <0,0,0> translate <0,0,R> pigment {color
rgb<1,1,1>} finish {emission radianceScene ambient 0.0 diffuse 0.0 specular
0.0}}

// cylinder shielding the FPA
cylinder {<0,0,0>,<0,0,h>,c/2 open pigment {color rgb<1,1,1>} finish {emission
radianceRS ambient 0 diffuse 0} }

// disc with hole acting as aperture between scene (the disc) and the FPA
disc {<0,0,h>,<0,0,1>, c/2, d/2 pigment {color rgb<1,1,1>} finish {emission
radianceRS ambient 0 diffuse 0}}


Post a reply to this message

From: clipka
Subject: Re: Simulate a camera with no lens
Date: 9 Jun 2011 06:43:09
Message: <4df0a3bd@news.povray.org>
Am 08.06.2011 23:38, schrieb Crippso:

> The only thing I'm struggling with now are the radiosity settings. At first I
> had quite blotchy images but I've played around with the settings a bit and have
> got a pretty smooth output now. However the brightness across the image is not
> perfectly symmetric as it should be. (I'm using Scilab to open up my 16 bit png
> files so i can inspect the rgb values carefully)

As POV-Ray's radiosity algorithm is not an exact solution to the problem 
of global illumination (it computes some integrals using a monte carlo 
approach), it will not be possible to achieve perfect symmetry, no 
matter how hard you try.


Post a reply to this message

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