Brown Distortion Model

struct BrownCoefficients : public huira::DistortionCoefficients

Coefficients for Brown lens distortion model.

Holds the radial (k1, k2, k3) and tangential (p1, p2) distortion coefficients.

Public Functions

BrownCoefficients() = default
inline constexpr BrownCoefficients(double k1_val, double k2_val, double k3_val, double p1_val, double p2_val)

Public Members

double k1 = 0
double k2 = 0
double k3 = 0
double p1 = 0
double p2 = 0
template<IsSpectral TSpectral>
class BrownDistortion : public huira::Distortion<TSpectral>

Brown lens distortion model.

Implements the Brown-Conrady distortion model with radial and tangential coefficients.

Template Parameters:

TSpectral – The spectral representation type.

Public Functions

BrownDistortion() = default
explicit BrownDistortion(BrownCoefficients coefficients)

Constructs a BrownDistortion with the given coefficients.

Parameters:

coefficients – The Brown distortion coefficients (radial and tangential).

virtual Pixel distort(Pixel homogeneous_coords) const override

Applies Brown distortion to the given pixel coordinates.

Computes the distorted coordinates by adding the Brown distortion delta.

Parameters:

homogeneous_coords – The input pixel coordinates (homogeneous).

Returns:

The distorted pixel coordinates.

virtual Pixel undistort(Pixel homogeneous_coords) const override

Removes Brown distortion from the given pixel coordinates.

Iteratively computes the undistorted coordinates using the Brown model.

Parameters:

homogeneous_coords – The distorted pixel coordinates (homogeneous).

Returns:

The undistorted pixel coordinates.

inline virtual std::string get_type_name() const override
inline virtual DistortionCoefficients *get_coefficients() override
inline virtual const DistortionCoefficients *get_coefficients() const override
inline void set_max_iterations(std::size_t max_iters)
inline std::size_t get_max_iterations() const
inline void set_tolerance(float tol)
inline float get_tolerance() const

Protected Attributes

std::size_t max_iterations_ = 20
double tol_sq_ = 1e-12
double tolerance_ = 1e-6