C# Класс Accord.Imaging.Filters.ContrastStretch

Contrast stretching filter.

Contrast stretching (or as it is often called normalization) is a simple image enhancement technique that attempts to improve the contrast in an image by 'stretching' the range of intensity values it contains to span a desired range of values, e.g. the full range of pixel values that the image type concerned allows. It differs from the more sophisticated histogram equalization in that it can only apply a linear scaling function to the image pixel values.

The result of this filter may be achieved by using ImageStatistics class, which allows to get pixels' intensities histogram, and LevelsLinear filter, which does linear correction of pixel's intensities.

The filter accepts 8 bpp grayscale and 24 bpp color images.

Sample usage:

// create filter ContrastStretch filter = new ContrastStretch( ); // process image filter.ApplyInPlace( sourceImage );

Source image:

Result image:

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

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

Метод Описание
ContrastStretch ( ) : Accord

Initializes a new instance of the ContrastStretch class.

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

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

Process the filter on the specified image.

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

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

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

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

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.
Результат void