Go to the documentation of this file.
17 #ifndef GAZEBO_RENDERING_DISTORTION_HH_
18 #define GAZEBO_RENDERING_DISTORTION_HH_
21 #include <ignition/math/Vector2.hh>
22 #include <sdf/Element.hh>
33 class DistortionPrivate;
50 public:
virtual void Load(sdf::ElementPtr _sdf);
54 public:
void SetCamera(
CameraPtr _camera);
60 public:
void SetCrop(
const bool _crop);
66 public:
bool Crop()
const;
70 public:
double K1()
const;
74 public:
double K2()
const;
78 public:
double K3()
const;
82 public:
double P1()
const;
86 public:
double P2()
const;
90 public: ignition::math::Vector2d Center()
const;
101 public:
static ignition::math::Vector2d Distort(
102 const ignition::math::Vector2d &_in,
103 const ignition::math::Vector2d &_center,
104 double _k1,
double _k2,
double _k3,
105 double _p1,
double _p2);
111 protected: ignition::math::Vector2d
112 DistortionMapValueClamped(
const int x,
const int y)
const;
117 protected:
void CalculateAndApplyDistortionScale();
121 private: std::unique_ptr<DistortionPrivate> dataPtr;
Forward declarations for the common classes.
Definition: Animation.hh:26
ignition::math::Vector2d Center() const
Get the distortion center.
double P1() const
Get the tangential distortion coefficient p1.
double K2() const
Get the radial distortion coefficient k2.
bool Crop() const
Get whether or not the camera is being cropped to account for black borders created by barrel distort...
virtual ~Distortion()
Destructor.
Camera distortion based on the Brown-Conrady model.
Definition: Distortion.hh:40
rendering
Definition: RenderEngine.hh:31
double K1() const
Get the radial distortion coefficient k1.
void CalculateAndApplyDistortionScale()
calculate the correct scale factor to "zoom" the render, cutting off black borders caused by distorti...
ignition::math::Vector2d DistortionMapValueClamped(const int x, const int y) const
get the distortion map value.
static ignition::math::Vector2d Distort(const ignition::math::Vector2d &_in, const ignition::math::Vector2d &_center, double _k1, double _k2, double _k3, double _p1, double _p2)
Apply distortion model.
void SetCamera(CameraPtr _camera)
Set the camera which distortion will be applied to.
boost::shared_ptr< Camera > CameraPtr
Definition: RenderTypes.hh:90
virtual void Load(sdf::ElementPtr _sdf)
Load the camera with a set of parmeters.
double K3() const
Get the radial distortion coefficient k3.
double P2() const
Get the tangential distortion coefficient p2.
void SetCrop(const bool _crop)
Set whether to crop the black border around the distorted image points.