ConvolutionMap.H File Reference

#include "Image/Image.H"
#include <vector>
#include <stdlib.h>
Include dependency graph for ConvolutionMap.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  convolutionMap< T >
 Container class for convolution maps. More...

Functions

template<class T >
void computeConvolutionMaps (convolutionMap< T > &cMap)
 Computes a set of convolution maps for doing multiple convolutions.
template<class T >
Image< T > convolveWithMaps (convolutionMap< T > &cMap)
 carries out a simple mapped convolution, call computeConvolutionMaps first

Detailed Description

Definition in file ConvolutionMap.H.


Function Documentation

template<class T >
void computeConvolutionMaps ( convolutionMap< T > &  cMap  )  [inline]

Computes a set of convolution maps for doing multiple convolutions.

When doing more than one convolution, for instance on an animated sequence, this builds a map set so that we precompute (A) border regions (B) very small kernel values These are removed and a vector of indexes is produced. These can then be used by iterating over the maps which contain the index.

Parameters:
cMap This is a container for the maps and images used

Definition at line 47 of file ConvolutionMap.C.

References convolutionMap< T >::CMcheckInit1(), convolutionMap< T >::CMimageArrayHandle, convolutionMap< T >::CMimageMap, convolutionMap< T >::CMindexMap, convolutionMap< T >::CMinit2, convolutionMap< T >::CMinitVecSize, convolutionMap< T >::CMkernel, convolutionMap< T >::CMkernelMap, convolutionMap< T >::CMkWeightNorm, convolutionMap< T >::CMorigImage, convolutionMap< T >::CMsmallNumber, convolutionMap< T >::CMstaticImage, Image< T >::getVal(), Image< T >::getWidth(), Image< T >::resize(), and Image< T >::setVal().

template<class T >
Image<T> convolveWithMaps ( convolutionMap< T > &  cMap  )  [inline]

carries out a simple mapped convolution, call computeConvolutionMaps first

This will take in the convolution maps created and the current image and compute convolution in a line. That is, for each pixel we can in a straight line iterate over all the image and kernel values using a map. This saves us from having to check for border regions and compute pixel locations. Additionally, we can pre-remove small values from convolution.

Parameters:
cMap This is a contaner for maps and images Example use:

convolutionMap<FLOAT> cMap; Image<float> inputImg;

...

if(frame == 1) { readMatrix rm("lowPassKernel.mat"); rm.echoMatrix(); cMap.CMsmallNumber = 1.1F; cMap.CMinitVecSize = 1; cMap.CMkernel = rm.returnMatrixAsImage(); cMap.CMorigImage = inputImg; computeConvolutionMaps(cMap); } cMap.CMcopyImage(inputImg); Image<FLOAT> i2 = convolveWithMaps(cMap);

Definition at line 156 of file ConvolutionMap.C.

References Image< T >::begin(), Image< T >::beginw(), convolutionMap< T >::CMcheckInit2(), convolutionMap< T >::CMimageMap, convolutionMap< T >::CMindexMap, convolutionMap< T >::CMkernelMap, convolutionMap< T >::CMkWeightNorm, convolutionMap< T >::CMpreciseVectors, convolutionMap< T >::CMstaticImage, Image< T >::end(), and ZEROS.

Generated on Sun May 8 08:42:41 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3