ImgDynamicThresholdAverage

Top  Previous  Next

Prototype

 

ImgDynamicThresholdAverage (intImageHandle, intLocalWidth,intLocalHeight, intLocalContrast, intBrightness)

 

Description

 

Converts a grayscale image applying dynamic thresholding based on average algo. For each pixel its evaluated its contrast respect other pixels in the local window  and if its above the local contrast value, it's binarized using the local threshold computed automatically averaging the pixels in the local window. The process can be customized selecting local windows size, local contrast and global brightness.

 

Parameters

 

intImageHandle: integer value corresponding to the image handle.

 

intLocalWidth: value specifying window width.

 

intLocalHeight: value specifying window height.

 

intLocalContrast: reference value for evaluating local contrast, between 0 and 255. Use -1 to allow auto-calculation of the best value for the image.

 

intBrightness: global brightness of resulting image, between 0 and 255. Low values produces a darker images, high values produce a lighter image. Use -1 to allow auto-calculation of the best value for the image.

 

 

Returned value

 

None.

 

Example

 

// Applies dynamic thresholding average

ImgDynamicThresholdAverage(_CurrentImage,7,7,8,128);