C# Class AForge.Imaging.Filters.ErrorDiffusionDithering

Base class for error diffusion dithering.

The class is the base class for binarization algorithms based on error diffusion.

Binarization with error diffusion in its idea is similar to binarization based on thresholding of pixels' cumulative value (see ThresholdWithCarry). Each pixel is binarized based not only on its own value, but on values of some surrounding pixels. During pixel's binarization, its binarization error is distributed (diffused) to some neighbor pixels with some coefficients. This error diffusion updates neighbor pixels changing their values, what affects their upcoming binarization. Error diffuses only on unprocessed yet neighbor pixels, which are right and bottom pixels usually (in the case if image processing is done from upper left corner to bottom right corner). Binarization error equals to processing pixel value, if it is below threshold value, or pixel value minus 255 otherwise.

The filter accepts 8 bpp grayscale images for processing.

Inheritance: BaseInPlacePartialFilter
Afficher le fichier Open project: holisticware-admin/MonoVersal.AForgeNET

Protected Properties

Свойство Type Description
startX int
startY int
stopX int
stopY int
stride int
x int
y int

Méthodes protégées

Méthode Description
Diffuse ( int error, byte ptr ) : void

Do error diffusion.

All parameters of the image and current processing pixel's coordinates are initialized in protected members.

ErrorDiffusionDithering ( ) : System

Initializes a new instance of the ErrorDiffusionDithering class.

ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

Diffuse() protected abstract méthode

Do error diffusion.
All parameters of the image and current processing pixel's coordinates are initialized in protected members.
protected abstract Diffuse ( int error, byte ptr ) : void
error int Current error value.
ptr byte Pointer to current processing pixel.
Résultat void

ErrorDiffusionDithering() protected méthode

Initializes a new instance of the ErrorDiffusionDithering class.
protected ErrorDiffusionDithering ( ) : System
Résultat System

ProcessFilter() protected méthode

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.
Résultat void

Property Details

startX protected_oe property

Processing X start position.
protected int startX
Résultat int

startY protected_oe property

Processing Y start position.
protected int startY
Résultat int

stopX protected_oe property

Processing X stop position.
protected int stopX
Résultat int

stopY protected_oe property

Processing Y stop position.
protected int stopY
Résultat int

stride protected_oe property

Processing image's stride (line size).
protected int stride
Résultat int

x protected_oe property

Current processing X coordinate.
protected int x
Résultat int

y protected_oe property

Current processing Y coordinate.
protected int y
Résultat int