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

ConvolutionMap.C File Reference


Detailed Description

Definition in file ConvolutionMap.C.

#include "Image/ConvolutionMap.H"
#include "rutz/trace.h"
#include <algorithm>
#include <cmath>
#include "inst/Image/ConvolutionMap.I"

Include dependency graph for ConvolutionMap.C:

Go to the source code of this file.

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


Function Documentation

template<class T>
void computeConvolutionMaps convolutionMap< T > &  cMap  ) 
 

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(), GVX_TRACE, i, Image< T >::resize(), Image< T >::setVal(), x, and y.

template<class T>
Image<T> convolveWithMaps convolutionMap< T > &  cMap  ) 
 

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(), Image< T >::endw(), GVX_TRACE, z, and ZEROS.


Generated on Sun Mar 21 13:53:25 2010 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4