NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkOpenGLMatrixDrivenCamera Class Reference

Subclass of vtkCamera so we can just set the relevant intrinsic matrix, the size of the image used in camera calibration, and the size of the actual window to get a calibrated camera view of the rendered scene. So, compared with vtkOpenGLCamera, this class ignores all the stuff to do with orthographic or perspective projection, and just uses the matrix and image/window size. More...

Inheritance diagram for vtkOpenGLMatrixDrivenCamera:
Inheritance graph
[legend]
Collaboration diagram for vtkOpenGLMatrixDrivenCamera:
Collaboration graph
[legend]

Public Member Functions

 vtkTypeMacro (vtkOpenGLMatrixDrivenCamera, vtkOpenGLCamera)
 
virtual void PrintSelf (ostream &os, vtkIndent indent) override
 
void Render (vtkRenderer *ren) override
 
 vtkSetMacro (UseCalibratedCamera, bool)
 
 vtkGetMacro (UseCalibratedCamera, bool)
 
void SetCalibratedImageSize (const int &width, const int &height, double pixelaspect=1.0)
 Set the size of the image in pixels that was used while calibrating the camera model. More...
 
void SetActualWindowSize (const int &width, const int &height)
 Set the window/widget size currently used. More...
 
void SetIntrinsicParameters (const double &fx, const double &fy, const double &cx, const double &cy)
 Set the intrinsic parameters as determined from camera calibration. More...
 

Static Public Member Functions

static
vtkOpenGLMatrixDrivenCamera
New ()
 

Protected Member Functions

 vtkOpenGLMatrixDrivenCamera ()
 
 ~vtkOpenGLMatrixDrivenCamera ()
 

Detailed Description

Subclass of vtkCamera so we can just set the relevant intrinsic matrix, the size of the image used in camera calibration, and the size of the actual window to get a calibrated camera view of the rendered scene. So, compared with vtkOpenGLCamera, this class ignores all the stuff to do with orthographic or perspective projection, and just uses the matrix and image/window size.

See also
http://sightations.wordpress.com/2010/08/03/simulating-calibrated-cameras-in-opengl/
http://jamesgregson.blogspot.co.uk/2011/11/matching-calibrated-cameras-with-opengl.html
http://strawlab.org/2011/11/05/augmented-reality-with-OpenGL/

where the last of these links seemed most intuitive to my way of thinking.

Constructor & Destructor Documentation

vtkOpenGLMatrixDrivenCamera::vtkOpenGLMatrixDrivenCamera ( )
protected
vtkOpenGLMatrixDrivenCamera::~vtkOpenGLMatrixDrivenCamera ( )
inlineprotected

Member Function Documentation

static vtkOpenGLMatrixDrivenCamera* vtkOpenGLMatrixDrivenCamera::New ( )
static
void vtkOpenGLMatrixDrivenCamera::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual
void vtkOpenGLMatrixDrivenCamera::Render ( vtkRenderer *  ren)
override
void vtkOpenGLMatrixDrivenCamera::SetActualWindowSize ( const int width,
const int height 
)

Set the window/widget size currently used.

Parameters
widthin pixels.
heightin pixels.
void vtkOpenGLMatrixDrivenCamera::SetCalibratedImageSize ( const int width,
const int height,
double  pixelaspect = 1.0 
)

Set the size of the image in pixels that was used while calibrating the camera model.

Parameters
widthin pixels.
heightin pixels.
pixelaspectis the width of a single pixel divided by its height.
void vtkOpenGLMatrixDrivenCamera::SetIntrinsicParameters ( const double &  fx,
const double &  fy,
const double &  cx,
const double &  cy 
)

Set the intrinsic parameters as determined from camera calibration.

Parameters
fxscale factor of combined focal length * effective pixel size in horizontal direction.
fyscale factor of combined focal length * effective pixel size in vertical direction.
cxcentre of projection in x axis.
cycentre of projection in y axis.
vtkOpenGLMatrixDrivenCamera::vtkGetMacro ( UseCalibratedCamera  ,
bool   
)
vtkOpenGLMatrixDrivenCamera::vtkSetMacro ( UseCalibratedCamera  ,
bool   
)
vtkOpenGLMatrixDrivenCamera::vtkTypeMacro ( vtkOpenGLMatrixDrivenCamera  ,
vtkOpenGLCamera   
)

The documentation for this class was generated from the following files: