C# Class AForge.Imaging.Filters.SaltAndPepperNoise

Salt and pepper noise.

The filter adds random salt and pepper noise - sets maximum or minimum values to randomly selected pixels.

The filter accepts 8 bpp grayscale images and 24/32 bpp color images for processing.

Sample usage:

// create filter SaltAndPepperNoise filter = new SaltAndPepperNoise( 10 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseInPlacePartialFilter
显示文件 Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
SaltAndPepperNoise ( ) : System

Initializes a new instance of the SaltAndPepperNoise class.

SaltAndPepperNoise ( double noiseAmount ) : System

Initializes a new instance of the SaltAndPepperNoise class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

ProcessFilter() protected method

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
return void

SaltAndPepperNoise() public method

Initializes a new instance of the SaltAndPepperNoise class.
public SaltAndPepperNoise ( ) : System
return System

SaltAndPepperNoise() public method

Initializes a new instance of the SaltAndPepperNoise class.
public SaltAndPepperNoise ( double noiseAmount ) : System
noiseAmount double Amount of noise to generate in percents, [0, 100].
return System