ThresholdDynamic Method (Image, Int32, Int32)

CVB.Net Documentation
This function performs dynamic thresholding on the input image with the Mean norm.

Namespace:  Stemmer.Cvb.Foundation
Assembly:  Stemmer.Cvb.Foundation (in Stemmer.Cvb.Foundation.dll) Version: 14.0.0.0
Syntax

public static Image Dynamic(
	Image img,
	int windowSize,
	int threshold
)

Parameters

img
Type: Stemmer.CvbImage
Image to be thresholded.
windowSize
Type: SystemInt32

Window size to be for calculating the dynamic threshold.

Bigger window sizes will lead to higher processing times.

threshold
Type: SystemInt32
Threshold offset to use

Return Value

Type: Image
The thresholded image.
Exceptions

ExceptionCondition
ArgumentNullExceptionIf the input img is null
ObjectDisposedExceptionIf the input img has already been disposed
Remarks

Dynamic thresholding works such that for each pixel of the input image, the average gray value over a mask with given size (centered around the pixel in question) is calculated. If the difference between this average and the pixel that is currently being looked at is above the specified threshold, then the corresponding pixel in the output image is set to white, otherwise it is black.

This function is particularly useful when dealing with images that have a non-uniform illumination.

See Also

Reference