2.6.6.6 imgNoise
Contents
Menu Information
Noise
Brief Information
Add random noise to image
Command Line Usage
1. imgnoise r:=5;
2. imgNoise r:=10 img:=mat(1) oimg:=mat(2) c:=green;
X-Function Execution Options
Please refer to the page for additional option switches when accessing the x-function from script
Variables
| Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
|---|---|---|---|---|
| Coverage | r |
Input int |
|
Specifies the percentage of coverage for the added noise. |
| Input Matrix | img |
Input Image |
|
Specifies the source image to be manipulated. The default input is the active image. |
| Output Image | oimg |
Output Image |
|
Specifies the output image. By default, the output image is the same as the input image. See the syntax here. |
| Channel | c |
Input int |
|
Specifies the channel(s) to add noise Option list
|
Description
The imgNoise function adds random noise to the input image. You can add noises to all channels or only a specified color channel.
Examples
In this example, we use the imgNoise function to add noise to the red channel of the input image:
- When the image is active, select Image: Spatial Filters: Noise to open the dialog of the X-Function.
- In the dialog, change the settings as the screenshot below and click OK to close the dialog.

A new image is created. We can see that there are some red noisy points added.
Algorithm
The computation uses L_AddBitmapNoise() function from LEADTOOLS Main API. Please refer to the LEADTOOLS Main API Help file, Version 14 and read the L_AddBitmapNoise topic.
References
LEADTOOLS Main API Help file, Version 14

