add_noise_distributionT_add_noise_distributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution (Operator)
Name
add_noise_distributionT_add_noise_distributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution
— Add noise to an image.
Signature
Description
add_noise_distributionadd_noise_distributionAddNoiseDistributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution
adds noise distributed according to
DistributionDistributionDistributionDistributiondistributiondistribution
to the ImageImageImageImageimageimage
. The resulting gray values are
clipped to the range of the corresponding pixel type.
The DistributionDistributionDistributionDistributiondistributiondistribution
is stored in a tuple of length 513. The individual
values of this tuple define the frequency of noise with a specific amplitude
defined by the position within the tuple. The central value, i.e., the
value at the position 256 in the tuple defines the frequency of pixels that
are not changed. The value at the position 255 defines the frequency of
pixels for which the grayvalue is decreased by 1. The value at the position
254 defines the respective frequency for a grayvalue decrease of 2, and so
on. Analogously, the value at position 257 defines the frequency of pixels
for which the grayvalue is increased by 1.
The DistributionDistributionDistributionDistributiondistributiondistribution
represents salt and pepper noise if at most one
value at a position smaller than 256 is not equal to zero and at most one
value at a position larger than 256 is not equal to zero. In case of salt
and pepper noise, the added noisy pixels are set to the minimum (pepper) and
maximum (salt) values that can be represented by ImageNoiseImageNoiseImageNoiseImageNoiseimageNoiseimage_noise
if the
amount of pepper is indicated by the value at position 0 and the amount of
salt is indicated by the value at position 512 in the tuple.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
- Automatically parallelized on channel level.
Parameters
ImageImageImageImageimageimage
(input_object) (multichannel-)image(-array) →
objectHImageHObjectHImageHobject (byte / int2)
Input image.
ImageNoiseImageNoiseImageNoiseImageNoiseimageNoiseimage_noise
(output_object) (multichannel-)image(-array) →
objectHImageHObjectHImageHobject * (byte / int2)
Noisy image.
Number of elements: ImageNoise == Image
DistributionDistributionDistributionDistributiondistributiondistribution
(input_control) distribution.values-array →
HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)
Noise distribution.
Number of elements: 513
Example (HDevelop)
read_image(Image,'mreut')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
Example (C)
read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
set_d(PerSalt,30.0,0);
set_d(PerPepper,30.0,0);
T_sp_distribution(PerSalt,PerPepper,&Dist);
T_add_noise_distribution(Image,&ImageNoise,Dist);
disp_image(ImageNoise,WindowHandle);
Example (HDevelop)
read_image(Image,'mreut')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
Example (HDevelop)
read_image(Image,'mreut')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
Example (HDevelop)
read_image(Image,'mreut')
dev_display (Image)
sp_distribution(30,30,Dist)
add_noise_distribution(Image,ImageNoise,Dist)
dev_display (ImageNoise)
Result
add_noise_distributionadd_noise_distributionAddNoiseDistributionAddNoiseDistributionAddNoiseDistributionadd_noise_distribution
returns 2 (H_MSG_TRUE) if all parameters are correct.
If the input is empty the behavior can be set via
set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)
. If
necessary, an exception is raised.
Possible Predecessors
gauss_distributiongauss_distributionGaussDistributionGaussDistributionGaussDistributiongauss_distribution
,
sp_distributionsp_distributionSpDistributionSpDistributionSpDistributionsp_distribution
,
noise_distribution_meannoise_distribution_meanNoiseDistributionMeanNoiseDistributionMeanNoiseDistributionMeannoise_distribution_mean
Alternatives
add_noise_whiteadd_noise_whiteAddNoiseWhiteAddNoiseWhiteAddNoiseWhiteadd_noise_white
See also
sp_distributionsp_distributionSpDistributionSpDistributionSpDistributionsp_distribution
,
gauss_distributiongauss_distributionGaussDistributionGaussDistributionGaussDistributiongauss_distribution
,
noise_distribution_meannoise_distribution_meanNoiseDistributionMeanNoiseDistributionMeanNoiseDistributionMeannoise_distribution_mean
,
add_noise_whiteadd_noise_whiteAddNoiseWhiteAddNoiseWhiteAddNoiseWhiteadd_noise_white
Module
Foundation