SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SourceXtractor::DFTConvolution< T, TPadding > Class Template Reference

#include <DFT.h>

Collaboration diagram for SourceXtractor::DFTConvolution< T, TPadding >:
Collaboration graph
[legend]

Classes

struct  ConvolutionContext
 

Public Types

typedef T real_t
 
typedef FFT< T >::complex_t complex_t
 

Public Member Functions

 DFTConvolution (std::shared_ptr< const Image< T >> img)
 
virtual ~DFTConvolution ()=default
 
std::size_t getWidth () const
 
std::size_t getHeight () const
 
std::unique_ptr
< ConvolutionContext
prepare (const std::shared_ptr< const Image< T >> &model_ptr) const
 
template<typename... Args>
void convolve (std::shared_ptr< WriteableImage< T >> image_ptr, std::unique_ptr< ConvolutionContext > &context, Args...padding_args) const
 
template<typename... Args>
void convolve (std::shared_ptr< WriteableImage< T >> image_ptr, Args...padding_args) const
 
std::shared_ptr< const Image< T > > getKernel () const
 

Protected Member Functions

void padKernel (ConvolutionContext &context) const
 
void dumpImage (const std::shared_ptr< const Image< T >> &img, std::vector< T > &work_area) const
 

Private Attributes

std::shared_ptr< const Image< T > > m_kernel
 

Detailed Description

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
class SourceXtractor::DFTConvolution< T, TPadding >

Convolution strategy based on the Discrete Fourier Transform

Template Parameters
TThe pixel type
TPaddingThe padding strategy

Definition at line 47 of file DFT.h.

Member Typedef Documentation

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
typedef FFT<T>::complex_t SourceXtractor::DFTConvolution< T, TPadding >::complex_t

Definition at line 50 of file DFT.h.

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
typedef T SourceXtractor::DFTConvolution< T, TPadding >::real_t

Definition at line 49 of file DFT.h.

Constructor & Destructor Documentation

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
SourceXtractor::DFTConvolution< T, TPadding >::DFTConvolution ( std::shared_ptr< const Image< T >>  img)
inlineexplicit

Constructor

Parameters
imgConvolution kernel

Definition at line 73 of file DFT.h.

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
virtual SourceXtractor::DFTConvolution< T, TPadding >::~DFTConvolution ( )
virtualdefault

Destructor

Member Function Documentation

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
template<typename... Args>
void SourceXtractor::DFTConvolution< T, TPadding >::convolve ( std::shared_ptr< WriteableImage< T >>  image_ptr,
std::unique_ptr< ConvolutionContext > &  context,
Args...  padding_args 
) const
inline

Convolve the image with the stored kernel, using the given context storing the pre-computed kernel transform, and pre-allocated buffers

Template Parameters
ArgsTypes of the parameters to be forwarded to the padding strategy
Parameters
image_ptrThe image to convolve
contextThe prepared context
padding_argsForwarded to the padding strategy

Definition at line 152 of file DFT.h.

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::convolve(), and SourceXtractor::BgDFTConvolutionImageSource::generateTile().

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
template<typename... Args>
void SourceXtractor::DFTConvolution< T, TPadding >::convolve ( std::shared_ptr< WriteableImage< T >>  image_ptr,
Args...  padding_args 
) const
inline

Convolve the image with the stored kernel

Template Parameters
ArgsTypes of the parameters to be forwarded to the padding strategy
Parameters
image_ptrThe image to convolve
padding_argsForwarded to the padding strategy
Note
The context will be computed on the fly, and discarded. If multiple, similar, convolutions are to be done, use a combination of prepare/convolve

Definition at line 209 of file DFT.h.

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
void SourceXtractor::DFTConvolution< T, TPadding >::dumpImage ( const std::shared_ptr< const Image< T >> &  img,
std::vector< T > &  work_area 
) const
inlineprotected
template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
std::size_t SourceXtractor::DFTConvolution< T, TPadding >::getHeight ( ) const
inline
Returns
The height of the kernel

Definition at line 94 of file DFT.h.

Referenced by SourceXtractor::BgDFTConvolutionImageSource::generateTile().

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
std::shared_ptr<const Image<T> > SourceXtractor::DFTConvolution< T, TPadding >::getKernel ( ) const
inline
Returns
The convolution kernel

Definition at line 218 of file DFT.h.

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
std::size_t SourceXtractor::DFTConvolution< T, TPadding >::getWidth ( ) const
inline
Returns
The width of the kernel

Definition at line 86 of file DFT.h.

Referenced by SourceXtractor::BgDFTConvolutionImageSource::generateTile().

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
void SourceXtractor::DFTConvolution< T, TPadding >::padKernel ( ConvolutionContext context) const
inlineprotected
template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
std::unique_ptr<ConvolutionContext> SourceXtractor::DFTConvolution< T, TPadding >::prepare ( const std::shared_ptr< const Image< T >> &  model_ptr) const
inline

Pre-computes the transform of the kernel, adapted to the image passed by model_ptr

Parameters
model_ptrReference image. Only its size is used to compute the necessary padding, and kernel size before transformation
Returns
A context than can be used by convolve to avoid re-computing the kernel multiple times

Definition at line 106 of file DFT.h.

Referenced by SourceXtractor::DFTConvolution< DetectionImage::PixelType, PaddedType >::convolve().

Member Data Documentation

template<typename T = SeFloat, class TPadding = PaddedImage<T, Reflect101Coordinates>>
std::shared_ptr<const Image<T> > SourceXtractor::DFTConvolution< T, TPadding >::m_kernel
private

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