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