SyB3R - Synthetic Benchmark for 3D Reconstruction
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
syb3r::data::Camera Class Reference

Internal and external camera parameters. More...

#include <libs/Common/source/syb3r/data/Camera.h>

Public Member Functions

 Camera (const Camera &)=default
 
 Camera (const Eigen::Matrix3f &internalCalibration, const Eigen::Matrix4f &externalCalibration, unsigned width, unsigned height)
 
 Camera (const Eigen::Matrix3f &internalCalibration, const Eigen::Matrix3f &cameraRotation, const Eigen::Vector3f &cameraPosition, unsigned width, unsigned height)
 
const Eigen::Matrix3f & getInternalCalibration () const
 Transforms from view space to image space. More...
 
const Eigen::Vector3f & getRadialDistortion (unsigned colorChannel) const
 
const Eigen::Matrix4f & getExternalCalibration () const
 Transforms from world space to view space. More...
 
const Eigen::Vector3f & getFocalPoint () const
 Returns the position of the camera.
 
const Eigen::Matrix3f & getRotation () const
 Returns the camera rotation from world space to view space.
 
unsigned getWidth () const
 Width (in pixels) of the produced images.
 
unsigned getHeight () const
 Height (in pixels) of the produced images.
 
float getFocalLength35mm () const
 

Protected Member Functions

void computeRotationPositionFromExtCalib ()
 

Protected Attributes

Eigen::Matrix3f m_internalCalibration
 
Eigen::Vector3f m_radialDistortion [3]
 
Eigen::Matrix4f m_externalCalibration
 
Eigen::Matrix3f m_rotation
 
Eigen::Vector3f m_focalPoint
 
unsigned m_width
 
unsigned m_height
 

Conversion

Todo:
move
static Camera convertFrom_PMVS_Matrix (const Eigen::Matrix< float, 3, 4 > &pmvsProjectionMatrix, unsigned width, unsigned height)
 
static Camera convertFrom_VSFM_NVM (float focalLength, const Eigen::Quaternionf &cameraRotation, const Eigen::Vector3f &cameraPosition, unsigned width, unsigned height)
 
static Camera convertFrom_DFM_SubsBA (const Eigen::Matrix< float, 3, 4 > &DFM_SubsBA_ProjectionMatrix, unsigned width, unsigned height)
 
static Camera readFromSceneXML (const tinyxml2::XMLElement *cameraNode)
 
Eigen::Matrix< float, 3, 4 > convertTo_PMVS_Matrix () const
 

Detailed Description

Internal and external camera parameters.

To be used for the ground truth as well as for the estimations.

Member Function Documentation

const Eigen::Matrix4f& syb3r::data::Camera::getExternalCalibration ( ) const
inline

Transforms from world space to view space.

In view space, the camera is located at the origin and looks in the z+ direction. The x+ direction is to the right and y+ is downwards.

float syb3r::data::Camera::getFocalLength35mm ( ) const
inline

Returns the horizontal focal length in 35mm equivalent

This is not necessarily the lens that was actually used. The sensor might not be full frame.

const Eigen::Matrix3f& syb3r::data::Camera::getInternalCalibration ( ) const
inline

Transforms from view space to image space.

Image space is [0 .. width] horizontally and [0 .. height] vertically, incrementing towards right and bottom respectively. Pixels span whole number intervals, eg. the top left pixel spans the quad from 0..1 in both x and y directions, it's center thus being located at (0.5, 0.5)

const Eigen::Vector3f& syb3r::data::Camera::getRadialDistortion ( unsigned  colorChannel) const
inline

Polynomial radial distortion with one vec3 for every coefficient to control the colors individually

Todo:
This will probably have to be way more flexible!

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