Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 220.127.116.11 (18.104.22.168)
public class ContrastStretch : BaseInPlacePartialFilter
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.
// create filter ContrastStretch filter = new ContrastStretch( ); // process image filter.ApplyInPlace( sourceImage );