POV-Ray : Newsgroups : povray.advanced-users : Obtaining Depth while using Anti-aliasing : Re: Obtaining Depth while using Anti-aliasing Server Time
22 Jun 2024 21:42:41 EDT (-0400)
  Re: Obtaining Depth while using Anti-aliasing  
From: handos
Date: 11 Jan 2013 06:05:01
Message: <web.50eff1d5e780593ad7ae32040@news.povray.org>
Hi Clipka,

Great! Thanks for letting me know that the anti-aliasing depth thing is fine. So
it is now back to the recovering camera parameters i.e. the Rotation and
Translation of the camera with respect to the world frame of reference.

cam_dir = cam_dir;
cam_pos = cam_pos;
cam_up  = cam_up;

z = cam_dir / norm(cam_dir);

x = cross(cam_up,z); // cross product of cam_up and z

x = x / norm(x);

y = cross(z,x); // cross product of z and x

R = [x y z];

T = cam_pos;

For instance

cam_pos      = [-0.892, 1.3, 2.814]';
cam_dir      = [-0.0217671, 0, -0.999763]';
cam_up       = [0, 1, 0]';
cam_lookat   = [-0.992, 1.3, -1.779]';
cam_sky      = [0, 1, 0]';
cam_right    = [-1.33302, 0, 0.0290228]';
cam_fpoint   = [0, 0, 1]';
cam_angle    = 90;

I get the R and T as:

R =

   -0.9998         0   -0.0218
         0    1.0000         0
    0.0218         0   -0.9998

T =

   -0.8920
    1.3000
    2.8140

That is how I obtain the R and T of the camera. Do you think it could go wrong
anywhere? Is it how you would obtain? If that all seems OK to you then it has to
be the calibration matrix "K" that projects the 3D points onto image plane that
could go wrong.

My camera is initialised in the povray script as

camera {
  perspective
  location   < 0.108+val01,1.3, 2.814>
  look_at  < 0.008+val01,1.3,-1.779>
}

where val01 is -1.0.

Kind Regards,
Ankur.


clipka <ano### [at] anonymousorg> wrote:
> Am 10.01.2013 12:22, schrieb handos:
>
> > I have updated the images with red-green channels to them at
> > http://www.doc.ic.ac.uk/~ahanda/anti_alias_depth.html I have also shown the
> > depth-maps next to the both images. They seem all OK to me (or maybe not!) but
> > let me know if there is something wrong with camera matrix?
>
> Unfortunately I'm not familiar with the data formats you're using in
> your project, or what a "K-matrix" is, nor do I have Matlab available to
> review your math.
>
> All I can tell is that yes, there seems to be /something/ wrong with
> what your algorithm /thinks/ were the camera parameters, and what the
> /actual/ camera parameters were. Relevant parameters that spring to my
> mind are:
>
> - camera position (seems easy enough, but you never know...)
> - camera direction
> - camera field of view (horizontally in this case)
>
> It might be interesting to see in comparison what happens if the camera
> is moved in a different manner; from the image material it seems that
> you're just rotating the camera horizontally around its location. What
> happens if you rotate it vertically instead? What if you change the
> camera location?
>
> Your algorithm's reaction to these different scenarios might help figure
> out what exactly is going wrong.
>
>
> (BTW, your original suspected culprit, the anti-aliasing algorithm, is
> probably fine.)


Post a reply to this message

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