Herror ::add_noise_white (
    Hobject Image,
    Hobject *ImageNoise,
    const HTuple &Amp
)
HImage HImage::AddNoiseWhite (
    const HTuple &Amp
) const
HImageArray HImageArray::AddNoiseWhite (
    const HTuple &Amp
) const

Add noise to an image.

::add_noise_white adds noise to the image Image. The noise is white noise, equally distributed in the interval [-Amp,Amp], and is generated by using the C function ``drand48'' with an initial time dependent seed. Resulting gray values are clipped to the range [0,255].


Parameters

Image (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int2 )
Input image.

ImageNoise (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int2 )
Noisy image.
Number of elements: ImageNoise == Image

Amp (input_control)
real -> HTuple.double
Maximum noise amplitude.
Default value: 60.0
Suggested values: 1.0, 2.0, 5.0, 10.0, 20.0, 40.0, 60.0, 90.0
Typical range of values: 1.0 <= Amp <= 1000.0
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Amp > 0


Example
read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
add_noise_white(Image,&ImageNoise,90.0);
disp_image(ImageNoise,WindowHandle); 

Result

::add_noise_white returns H_MSG_TRUE if all parameters are correct. If the input is empty the behaviour can be set via ::set_system('no_object_result',<Result>). If necessary, an exception handling is raised.


Alternatives

::add_noise_distribution


See also

::add_noise_distribution, ::noise_distribution_mean, ::gauss_distribution, ::sp_distribution


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH