gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmGraphics::RectilinearCameraModel Class Reference

Coordinates mapper that compensates for the optical effects as described by a rectilinear camera model. More...

#include <RectilinearCameraModel.hh>

Inheritance diagram for gramods::gmGraphics::RectilinearCameraModel:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::RectilinearCameraModel:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

std::string getCommonCode () override
 
std::string getTo2DCode () override
 
std::string getTo3DCode () override
 
void setCommonUniforms (GLuint program) override
 
void setTo2DUniforms (GLuint program) override
 
void setKDistortion (gmCore::float3 k)
 Set the k distortion parameters (k1 k2 k3). More...
 
void setPDistortion (gmCore::float2 p)
 Set the p distortion parameters (p1 p2). More...
 
void setFocalDistance (gmCore::float2 f)
 Set the focal distance (fx fy) for the camera model, expressed relative to the image size. More...
 
void setFocalOffset (gmCore::float2 c)
 Set the focal offset (cx cy) for the camera model, expressed relative to the image size. More...
 
- Public Member Functions inherited from gramods::gmGraphics::CoordinatesMapper
virtual void setTo3DUniforms (GLuint program)
 Called by the code that is using this CoordinatesMapper object, to let it set the uniforms used by the to-3D code. More...
 
virtual std::string getDefaultKey () override
 Returns the default key, in Configuration, for the Object. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
virtual void traverse (Visitor *visitor)
 Calls the child Object's accept method, if such exist. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Protected Member Functions inherited from gramods::gmGraphics::CoordinatesMapper
const std::string withVarId (std::string) const
 
- Protected Attributes inherited from gramods::gmGraphics::CoordinatesMapper
const std::string var_id
 

Detailed Description

Coordinates mapper that compensates for the optical effects as described by a rectilinear camera model.

Member Function Documentation

◆ getCommonCode()

std::string gramods::gmGraphics::RectilinearCameraModel::getCommonCode ( )
overridevirtual

◆ getTo2DCode()

std::string gramods::gmGraphics::RectilinearCameraModel::getTo2DCode ( )
overridevirtual

◆ getTo3DCode()

std::string gramods::gmGraphics::RectilinearCameraModel::getTo3DCode ( )
overridevirtual

◆ setCommonUniforms()

void gramods::gmGraphics::RectilinearCameraModel::setCommonUniforms ( GLuint  program)
overridevirtual

◆ setFocalDistance()

void gramods::gmGraphics::RectilinearCameraModel::setFocalDistance ( gmCore::float2  f)

Set the focal distance (fx fy) for the camera model, expressed relative to the image size.

Calibration output from OpenCV is typically expressed in pixels so divide by the pixel size in each dimension, respectively, before entering values here.

To convert from focal distance in mm and sensor ratio, divide the focal distance by the size of your sensor (e.g. 28 mm lens with sensor size 23.5 x 15.6 mm gives fx = 28/23.5 and fy = 28/15.6). Use the largest sensor dimension for your largest image dimension. If the sensor size is unknown but your camera reports standard 35 mm equivalent focal distance, then instead divide this focal distance value by the standard sensor size, 36 x 27 mm (e.g. 28 mm equivalent gives fx = 28/36 and fy = 28/27). Adjust the smaller dimension if the image ratio does not perfectly match the standard ratio (4/3). If your camera only reports it actual focal distance (e.g. 2.2 mm in a phone camera) then multiply this by the reported crop factor and proceed by using this value in the standard sensor estimation.

XML-attribute: focalDistance

◆ setFocalOffset()

void gramods::gmGraphics::RectilinearCameraModel::setFocalOffset ( gmCore::float2  c)

Set the focal offset (cx cy) for the camera model, expressed relative to the image size.

A straight projection should have an offset close to (0.5 0.5). Calibration output from OpenCV is typically expressed in pixels so divide by resolution before entering values here.

XML-attribute: focalOffset

◆ setKDistortion()

void gramods::gmGraphics::RectilinearCameraModel::setKDistortion ( gmCore::float3  k)

Set the k distortion parameters (k1 k2 k3).

XML-attribute: kDistortion

◆ setPDistortion()

void gramods::gmGraphics::RectilinearCameraModel::setPDistortion ( gmCore::float2  p)

Set the p distortion parameters (p1 p2).

XML-attribute: pDistortion

◆ setTo2DUniforms()

void gramods::gmGraphics::RectilinearCameraModel::setTo2DUniforms ( GLuint  program)
overridevirtual

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