ImgAutoThreshold |
Top Previous Next |
Prototype
intThresholdUsed:=ImgAutoThreshold (intImageHandle, intThresholdMethod)
Description
Thresholds a grayscale image by automatically calculating the best threshold level. The threshold level is used globally and can be calculated using several algorithms.
Parameters
intImageHandle: integer value corresponding to the image handle.
intThresholdMethod: it specifies thresholding algorithm. Allowed values are:
0 = Otsu 1 = Lloyd 2 = Ridler-Calvard 3 = Uniform Error 4 = Standard Deviation 5 = Clustering 6 = Median
Returned value
The calculated threshold value from 0 - 255 used for binarization.
Note
See ImgThreshold, ImgAdvancedThreshold and ImgDynamicThreshold for alternative threshold methods.
Example
// Applies auto thresholding using the Lloyd algorithm ImgAutoThreshold(_CurrentImage,1); |