C# Class AForge.Imaging.Filters.BilateralSmoothing

Bilateral filter implementation - edge preserving smoothing and noise reduction that uses chromatic and spatial factors.

Bilateral filter conducts "selective" Gaussian smoothing of areas of same color (domains) which removes noise and contrast artifacts while preserving sharp edges.

Two major parameters SpatialFactor and ColorFactor define the result of the filter. By changing these parameters you may achieve either only noise reduction with little change to the image or get nice looking effect to the entire image.

Although the filter can use parallel processing large KernelSize values (greater than 25) on high resolution images may decrease speed of processing. Also on high resolution images small KernelSize values (less than 9) may not provide noticeable results.

More details on the algorithm can be found by following this link.

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

Sample usage:

// create filter BilateralSmoothing filter = new BilateralSmoothing( ); filter.KernelSize = 7; filter.SpatialFactor = 10; filter.ColorFactor = 60; filter.ColorPower = 0.5; // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseUsingCopyPartialFilter
Datei anzeigen Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
BilateralSmoothing ( ) : System

Initializes a new instance of the BilateralSmoothing class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage source, UnmanagedImage destination, Rectangle rect ) : void

Process the filter on the specified image.

Private Methods

Method Description
InitColorFunc ( ) : void
InitFilter ( ) : void
InitSpatialFunc ( ) : void
ProcessWithEdgeChecks ( UnmanagedImage source, UnmanagedImage destination, Rectangle rect ) : void
ProcessWithoutChecks ( UnmanagedImage source, UnmanagedImage destination, Rectangle rect ) : void
ProcessWithoutChecksParallel ( UnmanagedImage source, UnmanagedImage destination, Rectangle rect ) : void

Method Details

BilateralSmoothing() public method

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

ProcessFilter() protected method

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