PCL
pcl::FFTConvolution Class Reference

Fourier-based two-dimensional convolution. More...

#include <FFTConvolution.h>

+ Inheritance diagram for pcl::FFTConvolution:

Public Member Functions

 FFTConvolution ()=default
 
 FFTConvolution (const KernelFilter &filter)
 
 FFTConvolution (const ImageVariant &f)
 
 FFTConvolution (const FFTConvolution &x)
 
 FFTConvolution (FFTConvolution &&)=default
 
virtual ~FFTConvolution ()
 
void EnableMagnitudeOutput (bool enable=true)
 
void EnableRealComponentOutput (bool enable=true)
 
const KernelFilterFilter () const
 
const ImageVariantFilterImage () const
 
bool IsMagnitudeOutputEnabled () const
 
bool IsRealComponentOutputEnabled () const
 
FFTConvolutionoperator= (const FFTConvolution &x)
 
FFTConvolutionoperator= (FFTConvolution &&)=default
 
const ComplexImageResponseFunctionDFT () const
 
void SetFilter (const KernelFilter &filter)
 
void SetFilter (const ImageVariant &filter)
 
bool UsingFilter () const
 
- Public Member Functions inherited from pcl::ImageTransformation
 ImageTransformation ()=default
 
 ImageTransformation (const ImageTransformation &)=default
 
virtual ~ImageTransformation ()
 
template<class P >
GenericImage< P > & operator>> (GenericImage< P > &image) const
 
ImageVariantoperator>> (ImageVariant &image) const
 
- Public Member Functions inherited from pcl::ParallelProcess
 ParallelProcess ()=default
 
 ParallelProcess (const ParallelProcess &)=default
 
void DisableParallelProcessing (bool disable=true)
 
void EnableParallelProcessing (bool enable=true, int maxProcessors=0)
 
bool IsParallelProcessingEnabled () const
 
int MaxProcessors () const
 
ParallelProcessoperator= (const ParallelProcess &)=default
 
void SetMaxProcessors (int maxProcessors)
 
void Swap (ParallelProcess &process)
 

Protected Member Functions

void Apply (pcl::Image &) const override
 
void Apply (pcl::DImage &) const override
 
void Apply (pcl::UInt8Image &) const override
 
void Apply (pcl::UInt16Image &) const override
 
void Apply (pcl::UInt32Image &) const override
 
void Apply (pcl::ComplexImage &) const override
 
void Apply (pcl::DComplexImage &) const override
 

Detailed Description

FFTConvolution implements a high-performance, two-dimensional discrete convolution algorithm via fast Fourier transforms. It performs automatic fixing of border artifacts by applying Neumann boundary conditions (mirroring), and is able to convolve images and response functions of arbitrary sizes, only limited by the available memory.

See also
Convolution, SeparableConvolution, ATrousWaveletTransform, ImageTransformation

Definition at line 117 of file FFTConvolution.h.

Constructor & Destructor Documentation

◆ FFTConvolution() [1/5]

pcl::FFTConvolution::FFTConvolution ( )
default

Default constructor.

Note
This constructor yields an uninitialized instance that cannot be used before explicit association with a response function, specified either as a KernelFilter object or as an ImageVariant.

◆ FFTConvolution() [2/5]

pcl::FFTConvolution::FFTConvolution ( const KernelFilter filter)
inline

Constructs an FFTConvolution instance with the specified kernel filter.

Parameters
filterResponse function, or convolution filter. The specified object does not have to remain valid while this FFTConvolution instance is actively used, since it owns a private copy of the filter (note that KernelFilter is a reference-counted class).

Definition at line 139 of file FFTConvolution.h.

◆ FFTConvolution() [3/5]

pcl::FFTConvolution::FFTConvolution ( const ImageVariant f)
inline

Constructs an FFTConvolution instance with the specified response function image.

Parameters
fA reference to an ImageVariant whose transported image is the response function, or convolution filter. The transported image must remain valid while this FFTConvolution instance is actively used, or until a new response function is associated with this instance. The specified ImageVariant doesn't have to remain valid, since a FFTConvolution instance owns a private ImageVariant that transports the response function image.

Definition at line 158 of file FFTConvolution.h.

◆ FFTConvolution() [4/5]

pcl::FFTConvolution::FFTConvolution ( const FFTConvolution x)
inline

Copy constructor.

Definition at line 167 of file FFTConvolution.h.

◆ FFTConvolution() [5/5]

pcl::FFTConvolution::FFTConvolution ( FFTConvolution &&  )
default

Move constructor.

◆ ~FFTConvolution()

virtual pcl::FFTConvolution::~FFTConvolution ( )
inlinevirtual

Destroys this FFTConvolution object.

Definition at line 185 of file FFTConvolution.h.

Member Function Documentation

◆ Apply() [1/7]

void pcl::FFTConvolution::Apply ( pcl::Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [2/7]

void pcl::FFTConvolution::Apply ( pcl::DImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit floating point image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [3/7]

void pcl::FFTConvolution::Apply ( pcl::UInt8Image image) const
overrideprotectedvirtual

Applies this transformation to an 8-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [4/7]

void pcl::FFTConvolution::Apply ( pcl::UInt16Image image) const
overrideprotectedvirtual

Applies this transformation to a 16-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [5/7]

void pcl::FFTConvolution::Apply ( pcl::UInt32Image image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit unsigned integer image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [6/7]

void pcl::FFTConvolution::Apply ( pcl::ComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 32-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ Apply() [7/7]

void pcl::FFTConvolution::Apply ( pcl::DComplexImage image) const
overrideprotectedvirtual

Applies this transformation to a 64-bit complex image.

Reimplemented from pcl::ImageTransformation.

◆ EnableMagnitudeOutput()

void pcl::FFTConvolution::EnableMagnitudeOutput ( bool  enable = true)
inline

Causes this object to apply to real images by storing the magnitude of the complex convolution result. This is the default behavior.

See also
IsMagnitudeOutputEnabled(), EnableRealComponentOutput()

Definition at line 355 of file FFTConvolution.h.

References pcl::Apply(), pcl::AutoPointer< T, D >::Destroy(), and pcl::ImageVariant::Free().

◆ EnableRealComponentOutput()

void pcl::FFTConvolution::EnableRealComponentOutput ( bool  enable = true)
inline

Causes this object to apply to real images by copying the real component of the complex convolved result.

See also
IsRealComponentOutputEnabled(), EnableMagnitudeOutput()

Definition at line 344 of file FFTConvolution.h.

◆ Filter()

const KernelFilter& pcl::FFTConvolution::Filter ( ) const
inline

Returns a reference to the kernel filter currently associated with this FFTConvolution object. If this object does not use a kernel filter, either because it uses an image as its response function, or because this object has not been initialized, the returned filter is empty (i.e., it has no filter coefficients and zero dimensions).

Definition at line 229 of file FFTConvolution.h.

◆ FilterImage()

const ImageVariant& pcl::FFTConvolution::FilterImage ( ) const
inline

Returns a reference to the filter image currently associated with this FFTConvolution object. The referenced ImageVariant object will transport no image if this object does not use a filter image, either because it uses a kernel filter as its response function, or because this object has not been initialized.

The response function is actually the image transported by the returned ImageVariant. It can be an image of any supported data type.

Definition at line 245 of file FFTConvolution.h.

◆ IsMagnitudeOutputEnabled()

bool pcl::FFTConvolution::IsMagnitudeOutputEnabled ( ) const
inline

Returns true if this object applies to real images by storing the magnitude of the complex convolution result. This is the default behavior.

Returns false if this object applies to real images by copying the real component of the complex convolved result.

See also
IsRealComponentOutputEnabled(), EnableMagnitudeOutput()

Definition at line 333 of file FFTConvolution.h.

◆ IsRealComponentOutputEnabled()

bool pcl::FFTConvolution::IsRealComponentOutputEnabled ( ) const
inline

Returns true if this object applies to real images by copying the real component of the complex convolved result.

Returns false if this object applies to real images by storing the magnitude of the complex convolution result. This is the default behavior.

See also
IsMagnitudeOutputEnabled(), EnableRealComponentOutput()

Definition at line 318 of file FFTConvolution.h.

◆ operator=() [1/2]

FFTConvolution& pcl::FFTConvolution::operator= ( const FFTConvolution x)
inline

Copy assignment operator. Returns a reference to this object.

Definition at line 192 of file FFTConvolution.h.

◆ operator=() [2/2]

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

Move assignment operator. Returns a reference to this object.

◆ ResponseFunctionDFT()

const ComplexImage* pcl::FFTConvolution::ResponseFunctionDFT ( ) const
inline

Returns a pointer to the discrete Fourier transform (DFT) of the complex response function used internally by this FFTConvolution object, or nullptr if the response function has not been created yet.

The internal DFT of the response function is created and initialized the first time this FFTConvolution object is used to perform a convolution. It is reused to save memory and CPU resources, as long as successive transformations apply to target images with the same dimensions, or otherwise it is re-created on the fly, as necessary. It is destroyed when a new filter is associated with this object.

This function returns a pointer to a complex image that stores the DFT of the original filter after transforming it to wrap around order. This means that the original filter data has been splitted, mirrored, and redistributed to occupy the four corners of the complex 2-D matrix prior to calculating its DFT.

If this object has not been initialized, the returned pointer is nullptr.

Definition at line 303 of file FFTConvolution.h.

◆ SetFilter() [1/2]

void pcl::FFTConvolution::SetFilter ( const KernelFilter filter)
inline

Sets a new kernel filter as the response function to be applied by this FFTConvolution object.

The specified object does not have to remain valid while this FFTConvolution instance is actively used, since it owns a private copy of the filter (note that KernelFilter is a reference-counted class).

Definition at line 258 of file FFTConvolution.h.

References pcl::KernelFilter::Clone().

◆ SetFilter() [2/2]

void pcl::FFTConvolution::SetFilter ( const ImageVariant filter)
inline

Sets a new filter image as the response function to be applied by this FFTConvolution object.

The image transported by the specified ImageVariant must remain valid while this FFTConvolution instance is actively used, or until a new response function is associated with this instance. The ImageVariant doesn't have to remain valid, since this object owns a private ImageVariant that transports the response function image.

Definition at line 275 of file FFTConvolution.h.

◆ UsingFilter()

bool pcl::FFTConvolution::UsingFilter ( ) const
inline

Returns true if this FFTConvolution uses a KernelFilter object as its response function; false if it uses an image.

Definition at line 217 of file FFTConvolution.h.


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