This function performs dynamic thresholding on the input image.
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, DynamicThresholdNorm norm )
Parameters
- img
- Type: Stemmer.CvbImage
Image to be thresholded. - windowSize
- Type: SystemInt32
Window size to calculate the dynamic threshold.
Bigger window sizes will lead to higher processing times.
- threshold
- Type: SystemInt32
Threshold offset to use - norm
- Type: Stemmer.Cvb.FoundationDynamicThresholdNorm
Either Mean or MinMax.
Return Value
Type: ImageThe thresholded image.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | If the input img is null |
ObjectDisposedException | If the input img has already been disposed |
Remarks
Dynamic thresholding works by calculating the average gray value over a mask with given size(centered around the pixel in question) for each input pixel. 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