Class FisheyeDistortion¶
Defined in File distortion-fisheye.h
Inheritance Relationships¶
Base Type¶
public aslam::Cloneable< Distortion, FisheyeDistortion >
(Template Class Cloneable)
Class Documentation¶
-
class
aslam
::
FisheyeDistortion
: public aslam::Cloneable<Distortion, FisheyeDistortion>¶ An implementation of the fisheye distortion model for pinhole cameras.
Constructors/destructors and operators
-
explicit
FisheyeDistortion
(const Eigen::VectorXd &distortionParams)¶ FisheyeDistortion Ctor.
- Parameters
[in] distortionParams
: Vector containing the distortion parameter. (dim=1: w)
-
FisheyeDistortion
(const FisheyeDistortion&) = default¶ Copy constructor for clone operation.
-
void
operator=
(const FisheyeDistortion&) = delete¶
-
friend friend std::ostream & operator<< (std::ostream &out, const FisheyeDistortion &distortion)
Convenience function to print the state using streams.
Distort methods: applies the distortion model to a point.
-
virtual void
distortUsingExternalCoefficients
(const Eigen::VectorXd *dist_coeffs, Eigen::Vector2d *point, Eigen::Matrix2d *out_jacobian) const¶ 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.
-
template<typename
ScalarType
, typenameMDistortion
>
voiddistortUsingExternalCoefficients
(const Eigen::MatrixBase<MDistortion> &dist_coeffs, const Eigen::Matrix<ScalarType, 2, 1> &point, Eigen::Matrix<ScalarType, 2, 1> *out_point) const¶ Template version of the distortExternalCoeffs function.
- Parameters
[in] dist_coeffs
: Vector containing the coefficients for the distortion model.[in] point
: The point in the normalized image plane. After the function, this point is distorted.[out] out_point
: The distorted point.
-
virtual void
distortParameterJacobian
(const Eigen::VectorXd *dist_coeffs, const Eigen::Vector2d &point, Eigen::Matrix<double, 2, Eigen::Dynamic> *out_jacobian) const¶ 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.
-
virtual void
undistortUsingExternalCoefficients
(const Eigen::VectorXd &dist_coeffs, Eigen::Vector2d *point) const¶ 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 support unit testing.
-
static inline FisheyeDistortion::UniquePtr
createTestDistortion
()¶ Create a test distortion object for unit testing.
Methods to set/get distortion parameters
-
virtual bool
distortionParametersValid
(const Eigen::VectorXd &dist_coeffs) const¶ 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.
-
inline virtual int
getParameterSize
() const¶ Returns the number of parameters used in the distortion model.
NOTE: Use the constexpr function parameterCount if you know the exact distortion type.
-
virtual void
printParameters
(std::ostream &out, const std::string &text) const¶ 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.
-
static bool
areParametersValid
(const Eigen::VectorXd ¶meters)¶ Static function that checks whether the given intrinsic parameters are valid for this model.
-
static inline constexpr size_t
parameterCount
()¶ Returns the number of parameters used in this distortion model.
Valid parameter range definition.
-
static inline double
getMinValidW
()¶ Get the min valid w. W is valid in range [kMinValidW, kMaxValidW].
-
static inline double
getMaxValidW
()¶ Get the max valid w. W is valid in range [kMinValidW, kMaxValidW].
Public Types
Public Functions
-
ASLAM_POINTER_TYPEDEFS
(FisheyeDistortion)¶
-
explicit