Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxAddBinaryNoise.h File Reference

More...

Go to the source code of this file.

Functions

HxImageRep L_HXIMAGEREP HxAddBinaryNoise (HxImageRep im, double percent=0.2)
 Add binary noise to an image. More...


Detailed Description


Function Documentation

HxImageRep L_HXIMAGEREP HxAddBinaryNoise HxImageRep    im,
double    percent = 0.2
 

Add binary noise to an image.

Numerical Recipes in C, 2nd edition, Cambridge University Press, Cambridge, 1992.

00028 {
00029     HxSizes sz = im.sizes();
00030     HxTagList   tags;
00031     HxAddTag(tags, "size", sz);
00032     HxAddTag(tags, "seed", -3);
00033     HxAddTag(tags, "percent", percent);
00034 
00035     HxImageRep noiseIm =  HxImageFactory::instance().fromNamedGenerator(
00036             HXIMAGESIG2DDOUBLE, "binaryNoise", tags);
00037 
00038     noiseIm = HxMulVal(noiseIm, HxPixMax(im));
00039 
00040     return HxAdd(noiseIm,im);
00041 
00042 //  return HxMul(im, noiseIm);
00043 }


Generated on Mon Jan 27 15:48:51 2003 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001