Class Distortion¶
Defined in File distortion.h
Inheritance Relationships¶
Derived Types¶
public aslam::Cloneable< Distortion, EquidistantDistortion >
(Template Class Cloneable)public aslam::Cloneable< Distortion, FisheyeDistortion >
(Template Class Cloneable)public aslam::Cloneable< Distortion, NullDistortion >
(Template Class Cloneable)public aslam::Cloneable< Distortion, RadTanDistortion >
(Template Class Cloneable)
Class Documentation¶
-
class
aslam
::
Distortion
¶ This class represents a standard implementation of the distortion block.
The function “distort” applies this nonlinear transformation. The function “undistort” applies the inverse transformation.
Subclassed by aslam::Cloneable< Distortion, EquidistantDistortion >, aslam::Cloneable< Distortion, FisheyeDistortion >, aslam::Cloneable< Distortion, NullDistortion >, aslam::Cloneable< Distortion, RadTanDistortion >
Constructors/destructors and operators
-
inline virtual
~Distortion
()¶
-
virtual bool
operator==
(const Distortion &rhs) const¶ Checks for same distortion type and same parameters.
- Return
Same distortion?
-
virtual aslam::Distortion *
clone
() const = 0¶ Clones the camera instance and returns a pointer to the copy.
-
Distortion
() = delete¶
-
Distortion
(const Eigen::VectorXd &dist_coeffs, Type distortion_type)¶ Distortion base constructor.
- Parameters
[in] dist_coeffs
: Vector containing the distortion parameters.[in] distortion_type
: DistortionType enum value with information which distortion model is used by the derived class.
-
Distortion
(const Distortion&) = default¶ Copy constructor for clone operation.
-
void
operator=
(const Distortion&) = delete¶
-
friend friend std::ostream & operator<< (std::ostream &out, const Distortion &distortion)
Convenience function to print the state using streams.
Distort methods: applies the distortion model to a point.
-
void
distort
(Eigen::Vector2d *point) const¶ Apply distortion to a point in the normalized image plane.
- Parameters
[inout] point
: The point in the normalized image plane. After the function, this point is distorted.
-
void
distort
(const Eigen::Vector2d &point, Eigen::Vector2d *out_point) const¶ Apply distortion to a point in the normalized image plane.
- Parameters
[in] point
: The point in the normalized image plane.[out] out_point
: The distorted point.
-
void
distort
(Eigen::Vector2d *point, Eigen::Matrix2d *out_jacobian) const¶ Apply distortion to a point in the normalized image plane.
- Parameters
[inout] point
: The point in the normalized image plane. After the function, this point is distorted.[out] out_jacobian
: The Jacobian of the distortion function with respect to small changes in the input point.
-
virtual void
distortUsingExternalCoefficients
(const Eigen::VectorXd *dist_coeffs, Eigen::Vector2d *point, Eigen::Matrix2d *out_jacobian) const = 0¶ Apply distortion to a point in the normalized image plane using provided distortion coefficients.
External distortion coefficients can be specified using this function. (Ignores the internally stored parameters.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients for the distortion model. NOTE: If nullptr, use internal distortion parameters.[inout] point
: The point in the normalized image plane. After the function, this point is distorted.[out] out_jacobian
: The Jacobian of the distortion function with respect to small changes in the input point. If NULL is passed, the Jacobian calculation is skipped.
-
virtual void
distortParameterJacobian
(const Eigen::VectorXd *dist_coeffs, const Eigen::Vector2d &point, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian) const = 0¶ Apply distortion to the point and provide the Jacobian of the distortion with respect to small changes in the distortion parameters.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients for the distortion model. NOTE: If nullptr, use internal distortion parameters.[in] point
: The point in the normalized image plane.[out] out_jacobian
: The Jacobian of the distortion with respect to small changes in the distortion parameters.
Undistort methods: Removes the modeled distortion effects from a point.
-
void
undistort
(Eigen::Vector2d *point) const¶ Apply undistortion to recover a point in the normalized image plane.
- Parameters
[inout] point
: The distorted point. After the function, this point is in the normalized image plane.
-
void
undistort
(const Eigen::Vector2d &point, Eigen::Vector2d *out_point) const¶ Apply undistortion to recover a point in the normalized image plane.
- Parameters
[in] point
: External distortion coefficients to use.[out] out_point
: The undistorted point in normalized image plane.
-
virtual void
undistortUsingExternalCoefficients
(const Eigen::VectorXd &dist_coeffs, Eigen::Vector2d *point) const = 0¶ Apply undistortion to recover a point in the normalized image plane using provided distortion coefficients.
External distortion coefficients can be specified using this function. Ignores the internally stored parameters.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients for the distortion model.[inout] point
: The distorted point. After the function, this point is in the normalized image plane.
Methods to set/get distortion parameters.
-
void
setParameters
(const Eigen::VectorXd &dist_coeffs)¶ Set the coefficients for the distortion model.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients.
-
inline const Eigen::VectorXd &
getParameters
() const¶ Get the distortion model coefficients.
- Return
Vector containing the coefficients.
-
inline double *
getParametersMutable
()¶ Get the pointer to the distortion model coefficients.
- Return
Pointer to the first coefficient.
-
virtual int
getParameterSize
() const = 0¶ Returns the number of parameters used in the distortion model.
NOTE: Use the constexpr function parameterCount if you know the exact distortion type.
-
virtual bool
distortionParametersValid
(const Eigen::VectorXd &dist_coeffs) const = 0¶ Check the validity of distortion parameters.
- Return
If the distortion parameters are valid.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients. Parameters will NOT be stored.
-
virtual void
printParameters
(std::ostream &out, const std::string &text) const = 0¶ Print the internal parameters of the distortion in a human-readable form Print to the ostream that is passed in.
The text is extra text used by the calling function to distinguish cameras.
Public Types
Public Functions
-
ASLAM_POINTER_TYPEDEFS
(Distortion)¶
-
inline virtual