Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Convolutions.H File Reference


Detailed Description

basic 1-D and 2-D filtering operations

Definition in file Convolutions.H.

#include "Image/Image.H"
#include "Util/Promotions.H"

Include dependency graph for Convolutions.H:

This graph shows which files directly or indirectly include this file:

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)


Enumeration Type Documentation

enum ConvolutionBoundaryStrategy
 

Enumerator:
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.


Function Documentation

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
[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().

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>
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).

With normalization by the local image energy, a la HMAX

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.

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).

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).

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.

Parameters:
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.


Generated on Thu Dec 4 10:21:33 2008 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4