C# Класс Accord.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:

Наследование: BaseUsingCopyPartialFilter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BilateralSmoothing ( ) : System

Initializes a new instance of the BilateralSmoothing class.

Защищенные методы

Метод Описание
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void

Process the filter on the specified image.

Приватные методы

Метод Описание
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

Описание методов

BilateralSmoothing() публичный Метод

Initializes a new instance of the BilateralSmoothing class.
public BilateralSmoothing ( ) : System
Результат System

ProcessFilter() защищенный Метод

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void
sourceData UnmanagedImage Source image data.
destinationData UnmanagedImage Destination image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void