PCL
pcl::VariableShapeFilter Class Reference

A kernel filter with variable kurtosis. More...

#include <VariableShapeFilter.h>

+ Inheritance diagram for pcl::VariableShapeFilter:

Public Member Functions

 VariableShapeFilter ()=default
 
 VariableShapeFilter (const VariableShapeFilter &)=default
 
 VariableShapeFilter (float sigma, float shape, float epsilon, float rho, float theta=0, const String &name=String())
 
 VariableShapeFilter (float sigma, float shape=2, float epsilon=0.01, const String &name=String())
 
 VariableShapeFilter (int n, float shape, float epsilon, float rho, float theta=0, const String &name=String())
 
 VariableShapeFilter (int n, float shape=2, float epsilon=0.01, const String &name=String())
 
 VariableShapeFilter (VariableShapeFilter &&)=default
 
float AspectRatio () const
 
SeparableFilter AsSeparableFilter (float tolerance=__PCL_DEFAULT_FILTER_SEPARABILITY_TOLERANCE) const override
 
KernelFilterClone () const override
 
double FWHM () const
 
double FWHMx () const
 
double FWHMy () const
 
bool IsSeparable () const override
 
VariableShapeFilteroperator= (const VariableShapeFilter &)=default
 
VariableShapeFilteroperator= (VariableShapeFilter &&)=default
 
void Resize (int n) override
 
float RotationAngle () const
 
void Set (float sigma)
 
void Set (float sigma, float shape)
 
void Set (float sigma, float shape, float epsilon)
 
void Set (float sigma, float shape, float epsilon, float rho)
 
void Set (float sigma, float shape, float epsilon, float rho, float theta)
 
void SetAspectRatio (float rho)
 
void SetRotationAngle (float theta)
 
void SetShape (float shape)
 
void SetSigma (float sigma)
 
void SetTruncation (float epsilon)
 
float Shape () const
 
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 VariableShapeFilter object is a specialized KernelFilter whose elements are calculated as a discrete representation of the following elliptical function centered at the origin:

G(x,y) = Exp( -( x^k/(k*sx^k) + y^k/(k*sy^k) ) )

where sx and sy are the standard deviations of the filter distribution on the horizontal and vertical axes, respectively, and k is a shape parameter controlling the kurtosis of the filter function. When k < 2 the distribution is leptokurtic (peaked), while k > 2 leads to a platykurtic (flat) distribution. When k = 2 the distribution is normal (Gaussian) and the VariableShapeFilter is equivalent to a GaussianFilter object with the same standard deviations.

VariableShapeFilter 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 VariableShapeFilter instance is formally defined by the following set of parameters:

sigma Standard deviation of the filter distribution on the X axis (sigma > 0).
shape Filter shape: 2 = Gaussian, < 2 = leptokurtic, > 2 = platykurtic (shape > 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.
epsilon Maximum truncation error of the computed filter coefficients (eps > 0).
See also
KernelFilter, GaussianFilter, MoffatFilter, LinearFilter

Definition at line 104 of file VariableShapeFilter.h.

Constructor & Destructor Documentation

◆ VariableShapeFilter() [1/7]

pcl::VariableShapeFilter::VariableShapeFilter ( )
default

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

◆ VariableShapeFilter() [2/7]

pcl::VariableShapeFilter::VariableShapeFilter ( float  sigma,
float  shape = 2,
float  epsilon = 0.01,
const String name = String() 
)
inline

Constructs a VariableShapeFilter object given the standard deviation sigma > 0, shape > 0, and coefficient truncation epsilon > 0. Assigns an optional name to the new filter object.

Definition at line 119 of file VariableShapeFilter.h.

◆ VariableShapeFilter() [3/7]

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

Constructs a VariableShapeFilter object given the standard deviation sigma > 0, shape > 0, coefficient 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 131 of file VariableShapeFilter.h.

◆ VariableShapeFilter() [4/7]

pcl::VariableShapeFilter::VariableShapeFilter ( int  n,
float  shape = 2,
float  epsilon = 0.01,
const String name = String() 
)
inline

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

Definition at line 142 of file VariableShapeFilter.h.

◆ VariableShapeFilter() [5/7]

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

Constructs a VariableShapeFilter object given the odd kernel size n >= 3, shape > 0, coefficient truncation 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 154 of file VariableShapeFilter.h.

◆ VariableShapeFilter() [6/7]

pcl::VariableShapeFilter::VariableShapeFilter ( const VariableShapeFilter )
default

Copy constructor.

◆ VariableShapeFilter() [7/7]

pcl::VariableShapeFilter::VariableShapeFilter ( VariableShapeFilter &&  )
default

Move constructor.

Member Function Documentation

◆ AspectRatio()

float pcl::VariableShapeFilter::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 276 of file VariableShapeFilter.h.

◆ AsSeparableFilter()

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

Returns a separable filter equivalent to this VariableShapeFilter object.

A VariableShapeFilter is separable when it represents an undistorted Gaussian distribution. This is only true when shape=2 and the filter is circular (rho=1). Otherwise an empty SeparableFilter object is returned because this filter is not separable.

Reimplemented from pcl::KernelFilter.

Definition at line 188 of file VariableShapeFilter.h.

◆ Clone()

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

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

Reimplemented from pcl::KernelFilter.

Definition at line 174 of file VariableShapeFilter.h.

◆ FWHM()

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

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

This function is an alias to FWHMx().

Definition at line 317 of file VariableShapeFilter.h.

◆ FWHMx()

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

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

Definition at line 295 of file VariableShapeFilter.h.

References pcl::Pow().

◆ FWHMy()

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

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

Definition at line 305 of file VariableShapeFilter.h.

◆ IsSeparable()

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

Returns true iff this filter is separable.

A VariableShapeFilter is separable only when it represents an undistorted Gaussian distribution. This is only true when shape=2 and the filter is circular (rho=1).

Reimplemented from pcl::KernelFilter.

Definition at line 205 of file VariableShapeFilter.h.

◆ operator=() [1/2]

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

Copy assignment operator. Returns a reference to this object.

◆ operator=() [2/2]

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

Move assignment operator. Returns a reference to this object.

◆ Resize()

void pcl::VariableShapeFilter::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 filter function on a matrix of the specified size, preserving the current shape, coefficient truncation, aspect ratio and rotation angle.

Reimplemented from pcl::KernelFilter.

Definition at line 422 of file VariableShapeFilter.h.

◆ RotationAngle()

float pcl::VariableShapeFilter::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 286 of file VariableShapeFilter.h.

◆ Set() [1/5]

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

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

Definition at line 367 of file VariableShapeFilter.h.

◆ Set() [2/5]

void pcl::VariableShapeFilter::Set ( float  sigma,
float  shape 
)
inline

Recalculates filter coefficients for the specified sigma > 0 and shape > 0. Coefficient truncation, aspect ratio and rotation angle are not changed.

Definition at line 357 of file VariableShapeFilter.h.

◆ Set() [3/5]

void pcl::VariableShapeFilter::Set ( float  sigma,
float  shape,
float  epsilon 
)
inline

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

Definition at line 347 of file VariableShapeFilter.h.

◆ Set() [4/5]

void pcl::VariableShapeFilter::Set ( float  sigma,
float  shape,
float  epsilon,
float  rho 
)
inline

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

Definition at line 337 of file VariableShapeFilter.h.

◆ Set() [5/5]

void pcl::VariableShapeFilter::Set ( float  sigma,
float  shape,
float  epsilon,
float  rho,
float  theta 
)
inline

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

Definition at line 327 of file VariableShapeFilter.h.

◆ SetAspectRatio()

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

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

Definition at line 402 of file VariableShapeFilter.h.

◆ SetRotationAngle()

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

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

Definition at line 411 of file VariableShapeFilter.h.

◆ SetShape()

void pcl::VariableShapeFilter::SetShape ( float  shape)
inline

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

Definition at line 384 of file VariableShapeFilter.h.

◆ SetSigma()

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

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

Definition at line 375 of file VariableShapeFilter.h.

◆ SetTruncation()

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

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

Definition at line 393 of file VariableShapeFilter.h.

◆ Shape()

float pcl::VariableShapeFilter::Shape ( ) const
inline

Returns the shape parameter of this VariableShapeFilter object. The shape parameter controls the kurtosis of the filter distribution:

shape < 2 Leptokurtic distribution
shape = 2 Normal (Gaussian) distribution
shape > 2 Platykurtic distribution

Definition at line 259 of file VariableShapeFilter.h.

◆ Sigma()

float pcl::VariableShapeFilter::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 244 of file VariableShapeFilter.h.

◆ SigmaX()

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

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

Definition at line 224 of file VariableShapeFilter.h.

◆ SigmaY()

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

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

Definition at line 233 of file VariableShapeFilter.h.

◆ Truncation()

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

Returns the maximum truncation error of calculated filter coefficients.

Definition at line 267 of file VariableShapeFilter.h.


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