Main Page   Class Overview   Pixels   Images   Geometry   Quick Index  

HxUniform.h File Reference

More...

#include "HxImageRep.h"

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxUniform (HxImageRep im, HxSizes sizes)
 Uniform filter. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxUniform HxImageRep    im,
HxSizes    sizes
 

Uniform filter.

00015 {
00016     // An image signature for a 2D image with 64-bit real valued scalar pixels
00017     HxImageSignature sig(2, 1, REAL_VALUE, 64);
00018 
00019     // Construct the separable kernels
00020     HxImageRep kx = HxImageFactory::instance().fromValue(sig,
00021         HxSizes(sizes.x(),1,1), 1./sizes.x());
00022     HxImageRep ky = HxImageFactory::instance().fromValue(sig,
00023         HxSizes(sizes.y(),1,1), 1./sizes.y());
00024     HxImageRep kz = HxImageFactory::instance().fromValue(sig,
00025         HxSizes(sizes.z(),1,1), 1./sizes.z());
00026 
00027     // and apply the operation
00028     if (im.dimensionality() == 3) {
00029         HxImageRep res = im.generalizedConvolutionK1d(1, kx,
00030             "mul", "addAssign", HxImageRep::ARITH_PREC);
00031         res = res.generalizedConvolutionK1d(2, ky,
00032             "mul", "addAssign", HxImageRep::ARITH_PREC);
00033         return res.generalizedConvolutionK1d(3, kz,
00034             "mul", "addAssign", HxImageRep::ARITH_PREC);
00035     }
00036         
00037     return im.genConvSeparated(
00038         1, kx, ky, "mul", "addAssign", HxImageRep::ARITH_PREC);
00039 }


Generated on Tue Jan 8 13:59:21 2002 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001