#include "Image/Image.H"
#include "Util/Promotions.H"
Go to the source code of this file.
Enumerations | |
enum | ConvolutionBoundaryStrategy { CONV_BOUNDARY_ZERO, CONV_BOUNDARY_CLEAN, CONV_BOUNDARY_REPLICATE } |
Functions | |
template<class T_or_RGB > | |
Image< typename promote_trait < T_or_RGB, float >::TP > | convolve (const Image< T_or_RGB > &src, const float *filter, const int Nx, const int Ny, ConvolutionBoundaryStrategy boundary) |
Brute force, super inefficient 2D convolution, with C filter of Nx*Ny. | |
template<class T_or_RGB > | |
Image< typename promote_trait < T_or_RGB, float >::TP > | convolve (const Image< T_or_RGB > &src, const Image< float > &filter, ConvolutionBoundaryStrategy boundary) |
Brute force, super inefficient 2D convolution. | |
template<class T > | |
Image< typename promote_trait < T, float >::TP > | optConvolve (const Image< T > &src, const Image< float > &filter) |
This is a somewhat-optimized 2-D convolution. | |
template<class T > | |
Image< typename promote_trait < T, float >::TP > | convolveHmax (const Image< T > &src, const Image< float > &filter) |
Brute force, super inefficient 2D convolution (truncated filter boundary). | |
template<class T_or_RGB > | |
Image< typename promote_trait < T_or_RGB, float >::TP > | sepFilter (const Image< T_or_RGB > &src, const Image< float > &hFilter, const Image< float > &vFilter, ConvolutionBoundaryStrategy boundary) |
Separable filter, any size (size=0 for no filter). | |
template<class T_or_RGB > | |
Image< typename promote_trait < T_or_RGB, float >::TP > | sepFilter (const Image< T_or_RGB > &src, const float *hFilter, const float *vFilter, const int hfsize, const int vfsize, ConvolutionBoundaryStrategy boundary) |
basic 1-D and 2-D filtering operations
Definition in file Convolutions.H.
CONV_BOUNDARY_ZERO |
zero-pad, a.k.a. truncated |
CONV_BOUNDARY_CLEAN |
normalize by the sum of the used filter coefficients |
CONV_BOUNDARY_REPLICATE |
replicate the nearest image pixel value |
Definition at line 47 of file Convolutions.H.
Image<typename promote_trait<T_or_RGB, float>::TP> convolve | ( | const Image< T_or_RGB > & | src, | |
const Image< float > & | filter, | |||
ConvolutionBoundaryStrategy | boundary | |||
) | [inline] |
Brute force, super inefficient 2D convolution.
Definition at line 64 of file Convolutions.H.
References convolve(), Image< T >::getArrayPtr(), Image< T >::getHeight(), and Image< T >::getWidth().
Image<typename promote_trait<T_or_RGB, float>::TP> convolve | ( | const Image< T_or_RGB > & | src, | |
const float * | filter, | |||
const int | Nx, | |||
const int | Ny, | |||
ConvolutionBoundaryStrategy | boundary | |||
) | [inline] |
Brute force, super inefficient 2D convolution, with C filter of Nx*Ny.
Referenced by convolve(), featureClusterVision< FLOAT >::fCVgetImageComplexStats(), maxNormalizeFancy(), and HmaxFL::windowedPatchDistance().
Image<typename promote_trait<T, float>::TP> convolveHmax | ( | const Image< T > & | src, | |
const Image< float > & | filter | |||
) | [inline] |
Brute force, super inefficient 2D convolution (truncated filter boundary).
With normalization by the local image energy, a la HMAX
Definition at line 305 of file Convolutions.C.
References ASSERT, Image< T >::begin(), Image< T >::beginw(), Image< T >::getHeight(), Image< T >::getWidth(), Image< T >::initialized(), NO_INIT, sqrt(), and sum().
Image<typename promote_trait<T, float>::TP> optConvolve | ( | const Image< T > & | src, | |
const Image< float > & | filter | |||
) | [inline] |
This is a somewhat-optimized 2-D convolution.
It is optimized in the sense that there are special-case inner loops for (1) cases where the filter doesn't completely overlap with the local image patch because we're at the image boundary (in this case we need a specialized inner loop to handle these boundary conditions), and (2) cases where the filter and local image patch overlap completely (in which case we can use a more efficient inner loop).
Definition at line 191 of file Convolutions.C.
References ASSERT, Image< T >::begin(), Image< T >::beginw(), Image< T >::getHeight(), Image< T >::getWidth(), Image< T >::initialized(), and NO_INIT.
Referenced by buildPyrGabor().
Image<typename promote_trait<T_or_RGB, float>::TP> sepFilter | ( | const Image< T_or_RGB > & | src, | |
const Image< float > & | hFilter, | |||
const Image< float > & | vFilter, | |||
ConvolutionBoundaryStrategy | boundary | |||
) | [inline] |
Separable filter, any size (size=0 for no filter).
If you want to do horizontal-only or vertical-only filtering, then simply pass an empty filter (i.e., Image<float>()) for the other filter.
boundary | controls the boundary-handling strategy (i.e., zero-fill, clean, replicate) |
HISTORICAL NOTE: This function takes over for what used to be many functions, including sepFilter(), sepFiltClean(), xFilter(), yFilter(), xFilterClean(), and yFilterClean(). First, the x+y variants are now collapsed into a single function; if you want x-only or y-only filtering, simply pass an empty image for the other filter. Second, the functions are collapsed across boundary handling strategy, where you can now select the boundary strategy at run-time with the ConvolutionBoundaryStrategy parameter.
Referenced by avgOrient(), VisualObject::computeKeypoints(), ColorHist::createFeatureVector(), SpectralResidualChannel::getOutput(), maxNormalizeFancy(), maxNormalizeFancyLandmark(), and ScaleSpace::ScaleSpace().