[ XITE Reference Manual | XITE home ]

Name

bin_etm - binarize a gray-scale band using Eikvil, Taxt and Moen`s method

Syntax

 #include <xite/binarize.h>

 int bin_etm( int region_size, int step_size,
    double dist_limit, double weight,
    int glob_min, int glob_max, int bin_method,
    IBAND inband, IBAND outband );

Description

The input band inband is binarized using the method of Eikvil, Taxt and Moen, the result returned in outband.

The pixels inside a small window S of size (small_window_size x small_window_size) are thresholded on basis of the clustering of the pixels inside a larger concentric window L of size (region_size x region_size) S and L slide across the image in steps equal to the side of S. For all pixels inside L, a threshold T is calculated to divide the pixels into two clusters. If the two estimated cluster means mu1 and mu2 are further apart than a limit, mu2 - mu1 > mean_diff_limit the pixels inside S are binarized using the threshold value T. When mu2 - mu1 < mean_diff_limit, the pixels inside S are all assigned to the class with the closest updated mean value, being it print or background.

bin_method is used to select the global binarization method which finds T. Use bin_method = OTSU or bin_method = KITTLER_ILLINGWORTH.

weight is used to calculate the updated mean values MU1 and MU2. For each small window S, the new values are caluculated as

 MU1 = 'weight' * MU1 + (1.0-'weight') * mu1
 MU2 = 'weight' * MU2 + (1.0-'weight') * mu2

weight = 1.0 means that the initial estimates for MU1 and MU2 are kept forever, while weight = 0.0 means that the mean values mu1 and mu2 of the two clusters in L are used in the next step.

For extremely difficult images, a preprocessing step can be used on the image. Replace all pixel values higher than the value glob_max by glob_max itself, and similarly, replace all pixel values lower than glob_min by glob_min.

Files

src/binarize/bin_etm.c

See also

binarize(1), bin_ot(3), bin_ki(3)

References

L. Eikvil, T. Taxt & K. Moen
"An Adaptive Method for Binarization of Grey Level Images", NOBIM National Conference on Image Processing and Pattern Recognition, pp 123-131, June 1991

Return value

 0 : ok
 1 : Bad input pixel type
 2 : Bad output pixel type

Restrictions

inband and outband must have pixel type unsigned byte.

Author

Řivind Due Trier

Id

$Id: bin_etm.c,v 1.16 1997/01/14 15:46:51 svein Exp $