C# Class Accord.Imaging.Filters.Threshold

Threshold binarization.

The filter does image binarization using specified threshold value. All pixels with intensities equal or higher than threshold value are converted to white pixels. All other pixels with intensities below threshold value are converted to black pixels.

The filter accepts 8 and 16 bpp grayscale images for processing.

Since the filter can be applied as to 8 bpp and to 16 bpp images, the ThresholdValue value should be set appropriately to the pixel format. In the case of 8 bpp images the threshold value is in the [0, 255] range, but in the case of 16 bpp images the threshold value is in the [0, 65535] range.

Sample usage:

// create filter Threshold filter = new Threshold( 100 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseInPlacePartialFilter
Afficher le fichier Open project: accord-net/framework Class Usage Examples

Protected Properties

Свойство Type Description
threshold int

Méthodes publiques

Méthode Description
Threshold ( ) : System

Initializes a new instance of the Threshold class.

Threshold ( int threshold ) : System

Initializes a new instance of the Threshold class.

Méthodes protégées

Méthode Description
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

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

Threshold() public méthode

Initializes a new instance of the Threshold class.
public Threshold ( ) : System
Résultat System

Threshold() public méthode

Initializes a new instance of the Threshold class.
public Threshold ( int threshold ) : System
threshold int Threshold value.
Résultat System

Property Details

threshold protected_oe property

Threshold value.
protected int threshold
Résultat int