PCL
pcl::MoffatFilter Class Reference

A kernel filter implementing a discrete Moffat distribution in two dimensions. More...

#include <MoffatFilter.h>

+ Inheritance diagram for pcl::MoffatFilter:

Public Member Functions

 MoffatFilter ()=default
 
 MoffatFilter (const MoffatFilter &)=default
 
 MoffatFilter (float sigma, float beta, float epsilon, float rho, float theta=0, const String &name=String())
 
 MoffatFilter (float sigma, float beta=4, float epsilon=0.01, const String &name=String())
 
 MoffatFilter (int n, float beta, float epsilon, float rho, float theta=0, const String &name=String())
 
 MoffatFilter (int n, float beta=4, float epsilon=0.01, const String &name=String())
 
 MoffatFilter (MoffatFilter &&)=default
 
float AspectRatio () const
 
SeparableFilter AsSeparableFilter (float tolerance=__PCL_DEFAULT_FILTER_SEPARABILITY_TOLERANCE) const override
 
float Beta () const
 
KernelFilterClone () const override
 
double FWHM () const
 
double FWHMx () const
 
double FWHMy () const
 
bool IsSeparable () const override
 
MoffatFilteroperator= (const MoffatFilter &)=default
 
MoffatFilteroperator= (MoffatFilter &&)=default
 
void Resize (int n) override
 
float RotationAngle () const
 
void Set (float sigma)
 
void Set (float sigma, float beta)
 
void Set (float sigma, float beta, float epsilon)
 
void Set (float sigma, float beta, float epsilon, float rho)
 
void Set (float sigma, float beta, float epsilon, float rho, float theta)
 
void SetAspectRatio (float rho)
 
void SetBeta (float beta)
 
void SetRotationAngle (float theta)
 
void SetSigma (float sigma)
 
void SetTruncation (float epsilon)
 
float Sigma () const
 
float SigmaX () const
 
float SigmaY () const
 
float Truncation () const
 
- Public Member Functions inherited from pcl::KernelFilter
 KernelFilter (const coefficient_matrix &F, const String &name=String())
 
 KernelFilter (const KernelFilter &)=default
 
 KernelFilter (const String &name=String())
 
template<typename T >
 KernelFilter (const T *k, int n, const String &name=String())
 
 KernelFilter (int n, const String &name=String())
 
template<typename T >
 KernelFilter (int n, const T &x, const String &name=String())
 
 KernelFilter (KernelFilter &&)=default
 
virtual ~KernelFilter ()
 
const coefficientBegin () const
 
const coefficientbegin () const
 
virtual void Clear ()
 
coefficient_matrix Coefficients () const
 
const coefficientEnd () const
 
const coefficientend () const
 
void Flip ()
 
KernelFilter Flipped () const
 
bool IsEmpty () const
 
bool IsFlipped () const
 
bool IsHighPassFilter () const
 
double Modulus () const
 
String Name () const
 
void Normalize ()
 
KernelFilter Normalized () const
 
int NumberOfCoefficients () const
 
 operator bool () const
 
KernelFilteroperator= (const coefficient &x)
 
KernelFilteroperator= (const coefficient_matrix &F)
 
KernelFilteroperator= (const KernelFilter &)=default
 
KernelFilteroperator= (KernelFilter &&)=default
 
bool operator== (const KernelFilter &f) const
 
const coefficientoperator[] (int row) const
 
virtual void Rename (const String &newName)
 
bool SameCoefficients (const KernelFilter &f) const
 
int Size () const
 
template<class P >
void ToImage (GenericImage< P > &image) const
 
void ToImage (ImageVariant &v) const
 
double Weight () const
 

Additional Inherited Members

- Public Types inherited from pcl::KernelFilter
using coefficient = float
 
using coefficient_matrix = GenericMatrix< coefficient >
 

Detailed Description

A MoffatFilter object is a specialized KernelFilter whose elements are calculated as a discrete representation of an elliptical Moffat[1] function centered at the origin:

M(x,y) = 1/(1 + x^2/sx^2 + y^2/sy^2)^beta

where sx and sy are the standard deviations of the distribution on the horizontal and vertical axes, respectively, and the beta exponent controls the shape of the function's profile. The lower the beta, the more peaked the overall shape of the function. For beta=1, the equation above corresponds to a Lorentzian function.

MoffatFilter also supports arbitrary rotation around the origin. When the filter is rotated, the coordinates x, y in the equation above are replaced by their rotated counterparts.

A MoffatFilter instance is formally defined by the following parameters:

sigma Standard deviation of the filter distribution on the X axis (sigma > 0).
rho The ratio sy/sx (see equation above) of the generated filter distribution (0 <= rho <= 1).
theta Rotation angle of the horizontal axis in radians (0 <= theta < PI). This parameter only makes sense when rho < 1.
beta Exponent controlling the overall shape of the function (beta > 0).
epsilon Maximum truncation error of the computed filter coefficients (eps > 0).

References

  • [1] Moffat, A. F. J., A Theoretical Investigation of Focal Stellar Images in the Photographic Emulsion and Application to Photographic Photometry, Astronomy and Astrophysics, Vol. 3, p. 455 (1969)
See also
KernelFilter, GaussianFilter, VariableShapeFilter, LinearFilter

Definition at line 105 of file MoffatFilter.h.

Constructor & Destructor Documentation

◆ MoffatFilter() [1/7]

pcl::MoffatFilter::MoffatFilter ( )
default

Constructs an empty MoffatFilter object with default functional parameters: sigma=2, beta=4, epsilon=0.01, rho=1, theta=0.

◆ MoffatFilter() [2/7]

pcl::MoffatFilter::MoffatFilter ( float  sigma,
float  beta = 4,
float  epsilon = 0.01,
const String name = String() 
)
inline

Constructs a MoffatFilter object given the standard deviation sigma > 0, beta exponent > 0 and truncation error epsilon > 0. Assigns an optional name to the new filter object.

Definition at line 120 of file MoffatFilter.h.

◆ MoffatFilter() [3/7]

pcl::MoffatFilter::MoffatFilter ( float  sigma,
float  beta,
float  epsilon,
float  rho,
float  theta = 0,
const String name = String() 
)
inline

Constructs a MoffatFilter object given the standard deviation sigma > 0, beta exponent > 0, truncation error epsilon > 0, aspect ratio 0 <= rho <= 1, and rotation angle 0 <= theta <= PI in radians. Assigns an optional name to the new filter object.

Definition at line 132 of file MoffatFilter.h.

◆ MoffatFilter() [4/7]

pcl::MoffatFilter::MoffatFilter ( int  n,
float  beta = 4,
float  epsilon = 0.01,
const String name = String() 
)
inline

Constructs a MoffatFilter object given the odd kernel size n >= 3, beta exponent > 0 and truncation error epsilon > 0. Assigns an optional name to the new filter object.

Definition at line 143 of file MoffatFilter.h.

◆ MoffatFilter() [5/7]

pcl::MoffatFilter::MoffatFilter ( int  n,
float  beta,
float  epsilon,
float  rho,
float  theta = 0,
const String name = String() 
)
inline

Constructs a MoffatFilter object given the odd kernel size n >= 3, beta exponent > 0, truncation error epsilon > 0, aspect ratio 0 <= rho <= 1, and rotation angle 0 <= theta <= PI in radians. Assigns an optional name to the new filter object.

Definition at line 155 of file MoffatFilter.h.

◆ MoffatFilter() [6/7]

pcl::MoffatFilter::MoffatFilter ( const MoffatFilter )
default

Copy constructor.

◆ MoffatFilter() [7/7]

pcl::MoffatFilter::MoffatFilter ( MoffatFilter &&  )
default

Move constructor.

Member Function Documentation

◆ AspectRatio()

float pcl::MoffatFilter::AspectRatio ( ) const
inline

Returns the aspect ratio of the filter distribution. This is the ratio vertical:horizontal between filter axes in the range [0,1].

Definition at line 260 of file MoffatFilter.h.

◆ AsSeparableFilter()

SeparableFilter pcl::MoffatFilter::AsSeparableFilter ( float  tolerance = __PCL_DEFAULT_FILTER_SEPARABILITY_TOLERANCE) const
inlineoverridevirtual

Returns a separable filter equivalent to this kernel filter.

MoffatFilter's reimplementation of this virtual member function returns an empty SeparableFilter object, as a Moffat filter is not separable.

Reimplemented from pcl::KernelFilter.

Definition at line 184 of file MoffatFilter.h.

◆ Beta()

float pcl::MoffatFilter::Beta ( ) const
inline

Returns the beta exponent of the Moffat filter function. The beta exponent controls the overall shape of the filter profile.

Definition at line 243 of file MoffatFilter.h.

◆ Clone()

KernelFilter* pcl::MoffatFilter::Clone ( ) const
inlineoverridevirtual

Returns a pointer to a dynamically allocated duplicate of this kernel filter.

Note
All derived classes from KernelFilter must reimplement this virtual member function.

Reimplemented from pcl::KernelFilter.

Definition at line 173 of file MoffatFilter.h.

◆ FWHM()

double pcl::MoffatFilter::FWHM ( ) const
inline

Returns the full width at half maximum, in sigma units, for the horizontal axis of the elliptical Moffat filter distribution.

This function is an alias to FWHMx().

Definition at line 301 of file MoffatFilter.h.

◆ FWHMx()

double pcl::MoffatFilter::FWHMx ( ) const
inline

Returns the full width at half maximum (FWHM), in sigma units, for the horizontal axis of the elliptical Moffat filter distribution.

Definition at line 279 of file MoffatFilter.h.

References pcl::Pow2(), and pcl::Sqrt().

◆ FWHMy()

double pcl::MoffatFilter::FWHMy ( ) const
inline

Returns the full width at half maximum (FWHM), in sigma units, for the vertical axis of the elliptical Moffat filter distribution.

Definition at line 289 of file MoffatFilter.h.

◆ IsSeparable()

bool pcl::MoffatFilter::IsSeparable ( ) const
inlineoverridevirtual

Returns true iff this filter is separable.

MoffatFilter's reimplementation of this virtual member function returns false, as a Moffat filter is not separable.

Reimplemented from pcl::KernelFilter.

Definition at line 195 of file MoffatFilter.h.

◆ operator=() [1/2]

MoffatFilter& pcl::MoffatFilter::operator= ( const MoffatFilter )
default

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

MoffatFilter& pcl::MoffatFilter::operator= ( MoffatFilter &&  )
default

Move assignment operator. Returns a reference to this object.

◆ Resize()

void pcl::MoffatFilter::Resize ( int  n)
inlineoverridevirtual

Recalculates filter coefficients for the given odd kernel size n >= 3. This routine computes the required standard deviation to sample the Moffat function on a matrix of the specified size, preserving the current beta exponent, coefficient truncation error, aspect ratio and rotation angle.

Reimplemented from pcl::KernelFilter.

Definition at line 407 of file MoffatFilter.h.

◆ RotationAngle()

float pcl::MoffatFilter::RotationAngle ( ) const
inline

Returns the rotation angle of the filter distribution. This is the rotation angle in radians with respect to the central pixel, in the range [0,+PI].

Definition at line 270 of file MoffatFilter.h.

◆ Set() [1/5]

void pcl::MoffatFilter::Set ( float  sigma)
inline

Recalculates filter coefficients for the specified sigma sigma > 0. The current beta exponent, coefficient truncation error, aspect ratio and rotation angle are not changed.

Definition at line 351 of file MoffatFilter.h.

◆ Set() [2/5]

void pcl::MoffatFilter::Set ( float  sigma,
float  beta 
)
inline

Recalculates filter coefficients for the specified sigma sigma > 0 and beta exponent. The current coefficient truncation error, aspect ratio and rotation angle are not changed.

Definition at line 341 of file MoffatFilter.h.

◆ Set() [3/5]

void pcl::MoffatFilter::Set ( float  sigma,
float  beta,
float  epsilon 
)
inline

Recalculates filter coefficients for the specified sigma sigma > 0, beta exponent and truncation error epsilon > 0. Does not change the current aspect ratio and rotation angle.

Definition at line 331 of file MoffatFilter.h.

◆ Set() [4/5]

void pcl::MoffatFilter::Set ( float  sigma,
float  beta,
float  epsilon,
float  rho 
)
inline

Recalculates filter coefficients for the specified sigma sigma > 0, beta exponent, truncation error epsilon > 0 and aspect ratio 0 <= rho <= 1. Does not change the current rotation angle.

Definition at line 321 of file MoffatFilter.h.

◆ Set() [5/5]

void pcl::MoffatFilter::Set ( float  sigma,
float  beta,
float  epsilon,
float  rho,
float  theta 
)
inline

Recalculates filter coefficients for the specified sigma sigma > 0, beta exponent, truncation error epsilon > 0, aspect ratio 0 <= rho <= 1 and rotation angle 0 <= theta <= PI in radians.

Definition at line 311 of file MoffatFilter.h.

◆ SetAspectRatio()

void pcl::MoffatFilter::SetAspectRatio ( float  rho)
inline

This is a convenience member function, equivalent to Set( Sigma(), Beta(), Truncation(), rho ).

Definition at line 386 of file MoffatFilter.h.

◆ SetBeta()

void pcl::MoffatFilter::SetBeta ( float  beta)
inline

This is a convenience member function, equivalent to Set( Sigma(), beta ).

Definition at line 368 of file MoffatFilter.h.

◆ SetRotationAngle()

void pcl::MoffatFilter::SetRotationAngle ( float  theta)
inline

This is a convenience member function, equivalent to Set( Sigma(), Beta(), Truncation(), AspectRatio(), a ).

Definition at line 395 of file MoffatFilter.h.

◆ SetSigma()

void pcl::MoffatFilter::SetSigma ( float  sigma)
inline

This is a convenience member function, equivalent to Set( sigma ).

Definition at line 359 of file MoffatFilter.h.

◆ SetTruncation()

void pcl::MoffatFilter::SetTruncation ( float  epsilon)
inline

This is a convenience member function, equivalent to Set( Sigma(), Beta(), epsilon ).

Definition at line 377 of file MoffatFilter.h.

◆ Sigma()

float pcl::MoffatFilter::Sigma ( ) const
inline

Returns the standard deviation of the filter distribution on the X (horizontal) axis.

This function is an alias to SigmaX().

Definition at line 234 of file MoffatFilter.h.

◆ SigmaX()

float pcl::MoffatFilter::SigmaX ( ) const
inline

Returns the standard deviation of the filter distribution on the X (horizontal) axis.

Definition at line 214 of file MoffatFilter.h.

◆ SigmaY()

float pcl::MoffatFilter::SigmaY ( ) const
inline

Returns the standard deviation of the filter distribution on the Y (vertical) axis.

Definition at line 223 of file MoffatFilter.h.

◆ Truncation()

float pcl::MoffatFilter::Truncation ( ) const
inline

Returns the maximum truncation error of the filter coefficients.

Definition at line 251 of file MoffatFilter.h.


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