IPSDK 0.2
IPSDK : Image Processing Software Development Kit
void gaussianRandomImg (inGaussianParameter,outImg)

Detailed Description

initialization of an image with random values generated using a normal law

This algorithm allows to fill an image with random sampled values. The pixel intensities follow a normal law defined by the given mean and standard deviation stored in an ipsdk::imaproc::attr::GaussianParameter attribute.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# create an image
img = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_UInt8, 510, 509)
# create a gaussian random image with a given mean and a given standard deviation
mean = 100
stdDev = 25
util.gaussianRandomImg(PyIPSDK.createGaussianParameter(mean, stdDev), img)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLUtility/Processor/GaussianRandomImg/GaussianRandomImg.h>

Code Example

// creation of an input image
ImageGeometryPtr pImageGeometry = geometry2d(imageBufferType, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pImg(boost::make_shared<MemoryImage>());
pImg->init(*pImageGeometry);
// Define the Gaussian parameters
GaussianParameterPtr pGaussianParameter = createGaussianParameter(fMean, fStdDev);
// initialize image content with random values in specified range
gaussianRandomImg(pGaussianParameter, pImg);