CamSim  0.0.0
A rasterization-based simulator for various types of cameras
Public Member Functions | Static Public Member Functions | List of all members
CamSim::Projection Class Reference

Defines the camera projection onto the image plane. More...

Public Member Functions

 Projection ()
 Constructor. More...
 
QSize imageSize () const
 Get the image size. More...
 
QMatrix4x4 projectionMatrix (float n, float f) const
 For OpenGL: Get the projection matrix for the given near and far plane values n and f. More...
 
QVector2D centerPixel () const
 For OpenCV: get the center pixel coordinates. More...
 
QVector2D focalLengths () const
 For OpenCV: get the focal lengths in x and y direction, in millimeters. More...
 
void setDistortion (float k1, float k2, float p1, float p2)
 Set lens distortion parameters, compatible to OpenCV. Set everything to zero to disable lens distortion. More...
 
void distortion (float *k1, float *k2, float *p1, float *p2)
 Get lens distortion parameters, compatible to OpenCV. More...
 

Static Public Member Functions

static Projection fromFrustum (int imageWidth, int imageHeight, float l, float r, float b, float t)
 Create a camera transformation from image size and frustum information (relative to a near plane value of 1) More...
 
static Projection fromOpeningAngle (int imageWidth, int imageHeight, float fovy)
 Create a camera transformation from image size and vertical opening angle (in degrees) More...
 
static Projection fromIntrinsics (int imageWidth, int imageHeight, float centerX, float centerY, float focalLengthX, float focalLengthY)
 Create a camera transformation from image size and camera intrinsic parameters as used by OpenCV. More...
 

Detailed Description

Defines the camera projection onto the image plane.

For OpenGL, this means viewport and projection matrix information. For OpenCV, this means image size and intrinsic parameter information.

Constructor & Destructor Documentation

◆ Projection()

CamSim::Projection::Projection ( )

Constructor.

Member Function Documentation

◆ centerPixel()

QVector2D CamSim::Projection::centerPixel ( ) const

For OpenCV: get the center pixel coordinates.

◆ distortion()

void CamSim::Projection::distortion ( float *  k1,
float *  k2,
float *  p1,
float *  p2 
)

Get lens distortion parameters, compatible to OpenCV.

◆ focalLengths()

QVector2D CamSim::Projection::focalLengths ( ) const

For OpenCV: get the focal lengths in x and y direction, in millimeters.

◆ fromFrustum()

static Projection CamSim::Projection::fromFrustum ( int  imageWidth,
int  imageHeight,
float  l,
float  r,
float  b,
float  t 
)
static

Create a camera transformation from image size and frustum information (relative to a near plane value of 1)

◆ fromIntrinsics()

static Projection CamSim::Projection::fromIntrinsics ( int  imageWidth,
int  imageHeight,
float  centerX,
float  centerY,
float  focalLengthX,
float  focalLengthY 
)
static

Create a camera transformation from image size and camera intrinsic parameters as used by OpenCV.

◆ fromOpeningAngle()

static Projection CamSim::Projection::fromOpeningAngle ( int  imageWidth,
int  imageHeight,
float  fovy 
)
static

Create a camera transformation from image size and vertical opening angle (in degrees)

◆ imageSize()

QSize CamSim::Projection::imageSize ( ) const

Get the image size.

◆ projectionMatrix()

QMatrix4x4 CamSim::Projection::projectionMatrix ( float  n,
float  f 
) const

For OpenGL: Get the projection matrix for the given near and far plane values n and f.

◆ setDistortion()

void CamSim::Projection::setDistortion ( float  k1,
float  k2,
float  p1,
float  p2 
)

Set lens distortion parameters, compatible to OpenCV. Set everything to zero to disable lens distortion.


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