[vtkusers] Calculate Camera space coordinates from vtk render
alykhantejani
alykhan.tejani06 at imperial.ac.uk
Thu Aug 8 07:23:13 EDT 2013
Hi,
I have rendered an image in vtk, I would like to project the image points
(x,y) to 3D camera frame coordinates. For each pixel (x,y) I have the z
value in the camera frame (obtained from the z-buffer).
Under the pinhole projection, the standard way to do this would be:
x_camera_frame = (x_pixel - cx) * z_camera_frame/ fx;
y_camera_frame = (y_pixel - cy) * z_camera_frame / fy;
where `fx` and `fy` are the focal length and `cx cy` is the centre of
projection of the camera (intrinsic parameters).
The problem is, with `vtkCamera` you can only set the field of view but
there is not way to set or get the focal length or center of projection, so
how would I go about calculating `x_camera_frame` and `y_camera_frame`?
Thanks
--
View this message in context: http://vtk.1045678.n5.nabble.com/Calculate-Camera-space-coordinates-from-vtk-render-tp5722576.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list