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

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Coverage r

Input

int

0

Specifies the percentage of coverage for the added noise.

Input Matrix img

Input

Image

<active>

Specifies the source image to be manipulated. The default input is the active image.

Output Image oimg

Output

Image

<input>

Specifies the output image. By default, the output image is the same as the input image. See the syntax .

Channel c

Input

int

all

Specifies the channel(s) to add noise

Option list

  • all:All
Adds noise to all channels.
  • red:Red
Adds noise to red channel only.
  • green:Green
Adds noise to green channel only.
  • blue:Blue
Adds noise to blue channel only.

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:

  1. When the image is active, select Image: Spatial Filters: Noise to open the dialog of the X-Function.
  2. 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.
The original image
The output image


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

Related X-Functions

, , ,