POV-Ray : Newsgroups : povray.newusers : get the rays back Server Time
29 Jul 2024 06:23:01 EDT (-0400)
  get the rays back (Message 1 to 4 of 4)  
From: zorro
Subject: get the rays back
Date: 31 Jul 2006 10:40:00
Message: <web.44ce15c61910e8fe7049ed940@news.povray.org>
Hi everybody.
I find POV-ray very useful to test my computer vision algorithm.
However I don't understand how focal length works. In particular after
rendering my image I need to get the rays back from the image pixel, or
better, given a image pixel at coordinate (x,y) of the image, I want to
associate to it the relevant ray that passes through the pinhole of the
camera (namely, its 3D equation).

For my preliminary experiments I use the simply standard camera
camera
{ location <0, 0, 0>
  direction <0,0,-1>
}

So I was wonder what is the value of focal length (1?), so that if I have
the pixel in (15,12) in the image (with the origin set in the middle of the
image) what is the equation of the ray associated to that pixel? How this is
also related to the resolution of the image?

Thank you.

Simone


Post a reply to this message

From: Verm
Subject: Re: get the rays back
Date: 31 Jul 2006 11:07:59
Message: <44ce1ccf@news.povray.org>
zorro wrote:
> Hi everybody.
> I find POV-ray very useful to test my computer vision algorithm.
> However I don't understand how focal length works. In particular after
> rendering my image I need to get the rays back from the image pixel, or
> better, given a image pixel at coordinate (x,y) of the image, I want to
> associate to it the relevant ray that passes through the pinhole of the
> camera (namely, its 3D equation).
> 
> For my preliminary experiments I use the simply standard camera
> camera
> { location <0, 0, 0>
>   direction <0,0,-1>
> }
> 
> So I was wonder what is the value of focal length (1?), so that if I have
> the pixel in (15,12) in the image (with the origin set in the middle of the
> image) what is the equation of the ray associated to that pixel? How this is
> also related to the resolution of the image?
> 
> Thank you.
> 
> Simone

To find out about the ray you are sending all you need is
1) the field of view of the image,
2) the aspect of the image (ratio of horizontal/vertical fields of view)
3) the position in the image.

1&2 can be set by the camera definition block and are explained in the 
docs. 3 is the pixel coordinates with relation to the size of the image.

There is not really such a thing as resolution in POV.

If you have a field of view of 90 then the middle pixel (320,240 in a 
640x480 image) points straight down the z axis, and the top left pixel 
points up 45 degrees and left 45 degrees. (You just need to mess around 
with right angled triangles for the rest) Try aiming cameras at unit 
cubes on chequered planes and you'll soon get the idea.


Post a reply to this message

From: Alain
Subject: Re: get the rays back
Date: 31 Jul 2006 18:54:36
Message: <44ce8a2c@news.povray.org>
zorro nous apporta ses lumieres en ce 31/07/2006 10:37:
> Hi everybody.
> I find POV-ray very useful to test my computer vision algorithm.
> However I don't understand how focal length works. In particular after
> rendering my image I need to get the rays back from the image pixel, or
> better, given a image pixel at coordinate (x,y) of the image, I want to
> associate to it the relevant ray that passes through the pinhole of the
> camera (namely, its 3D equation).
> 
> For my preliminary experiments I use the simply standard camera
> camera
> { location <0, 0, 0>
>   direction <0,0,-1>
> }
> 
> So I was wonder what is the value of focal length (1?), so that if I have
> the pixel in (15,12) in the image (with the origin set in the middle of the
> image) what is the equation of the ray associated to that pixel? How this is
> also related to the resolution of the image?
> 
> Thank you.
> 
> Simone
> 
> 
The default camera is similar to a pinn-hole camera. Pinn-hole cameras don't 
have focal lenght because they don't have any optics.

-- 
Alain
-------------------------------------------------
WARNING: The consumption of alcohol may lead you to think people are laughing 
WITH you.


Post a reply to this message

From: zorro
Subject: Re: get the rays back
Date: 1 Aug 2006 12:30:01
Message: <web.44cf739ddb214cf07049ed940@news.povray.org>
Thank you all for your precious advices.
Now I understand what I have to do. (and the results seem quite good :-)

thank you

Simone


Alain <ele### [at] netscapenet> wrote:
> zorro nous apporta ses lumieres en ce 31/07/2006 10:37:
> > Hi everybody.
> > I find POV-ray very useful to test my computer vision algorithm.
> > However I don't understand how focal length works. In particular after
> > rendering my image I need to get the rays back from the image pixel, or
> > better, given a image pixel at coordinate (x,y) of the image, I want to
> > associate to it the relevant ray that passes through the pinhole of the
> > camera (namely, its 3D equation).
> >
> > For my preliminary experiments I use the simply standard camera
> > camera
> > { location <0, 0, 0>
> >   direction <0,0,-1>
> > }
> >
> > So I was wonder what is the value of focal length (1?), so that if I have
> > the pixel in (15,12) in the image (with the origin set in the middle of the
> > image) what is the equation of the ray associated to that pixel? How this is
> > also related to the resolution of the image?
> >
> > Thank you.
> >
> > Simone
> >
> >
> The default camera is similar to a pinn-hole camera. Pinn-hole cameras don't
> have focal lenght because they don't have any optics.
>
> --
> Alain
> -------------------------------------------------
> WARNING: The consumption of alcohol may lead you to think people are laughing
> WITH you.


Post a reply to this message

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