Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
gazebo::rendering::Distortion Class Reference

Camera distortion based on Brown's model. More...

#include <rendering/rendering.hh>

Public Member Functions

 Distortion ()
 Constructor. More...
 
virtual ~Distortion ()
 Destructor. More...
 
math::Vector2d GetCenter () const
 Get the distortion center. More...
 
double GetK1 () const
 Get the radial distortion coefficient k1. More...
 
double GetK2 () const
 Get the radial distortion coefficient k2. More...
 
double GetK3 () const
 Get the radial distortion coefficient k3. More...
 
double GetP1 () const
 Get the tangential distortion coefficient p1. More...
 
double GetP2 () const
 Get the tangential distortion coefficient p2. More...
 
virtual void Load (sdf::ElementPtr _sdf)
 Load the camera with a set of parmeters. More...
 
void SetCamera (CameraPtr _camera)
 Set the camera which distortion will be applied to. More...
 
void SetCrop (bool _crop)
 Set whether to crop the black border around the distorted image points. More...
 

Static Public Member Functions

static math::Vector2d Distort (const math::Vector2d &_in, const math::Vector2d &_center, double _k1, double _k2, double _k3, double _p1, double _p2)
 Apply distortion model. More...
 

Protected Attributes

sdf::ElementPtr sdf
 Distortion SDF values. More...
 

Detailed Description

Camera distortion based on Brown's model.

Note that the current implementation only supports barrel distortion.

Constructor & Destructor Documentation

gazebo::rendering::Distortion::Distortion ( )

Constructor.

virtual gazebo::rendering::Distortion::~Distortion ( )
virtual

Destructor.

Member Function Documentation

static math::Vector2d gazebo::rendering::Distortion::Distort ( const math::Vector2d _in,
const math::Vector2d _center,
double  _k1,
double  _k2,
double  _k3,
double  _p1,
double  _p2 
)
static

Apply distortion model.

Parameters
[in]_inInput uv coordinate.
[in]_centerNormalized distortion center.
[in]_k1Radial distortion coefficient k1.
[in]_k2Radial distortion coefficient k2.
[in]_k3Radial distortion coefficient k3.
[in]_p1Tangential distortion coefficient p1.
[in]_p2Tangential distortion coefficient p2.
Returns
Distorted coordinate.
math::Vector2d gazebo::rendering::Distortion::GetCenter ( ) const

Get the distortion center.

Returns
Distortion center.
double gazebo::rendering::Distortion::GetK1 ( ) const

Get the radial distortion coefficient k1.

Returns
Distortion coefficient k1.
double gazebo::rendering::Distortion::GetK2 ( ) const

Get the radial distortion coefficient k2.

Returns
Distortion coefficient k2.
double gazebo::rendering::Distortion::GetK3 ( ) const

Get the radial distortion coefficient k3.

Returns
Distortion coefficient k3.
double gazebo::rendering::Distortion::GetP1 ( ) const

Get the tangential distortion coefficient p1.

Returns
Distortion coefficient p1.
double gazebo::rendering::Distortion::GetP2 ( ) const

Get the tangential distortion coefficient p2.

Returns
Distortion coefficient p2.
virtual void gazebo::rendering::Distortion::Load ( sdf::ElementPtr  _sdf)
virtual

Load the camera with a set of parmeters.

Parameters
[in]_sdfThe SDF camera info
void gazebo::rendering::Distortion::SetCamera ( CameraPtr  _camera)

Set the camera which distortion will be applied to.

Parameters
[in]_cameraCamera to be distorted
void gazebo::rendering::Distortion::SetCrop ( bool  _crop)

Set whether to crop the black border around the distorted image points.

Parameters
[in]_cropTrue to crop the black border

Member Data Documentation

sdf::ElementPtr gazebo::rendering::Distortion::sdf
protected

Distortion SDF values.


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