bin_nr

[ XITE Reference Manual | XITE home ]

Contents


Name

bin_nr - binarize a gray-scale band using Nakagawa and Rosenfeld`s method

Syntax

 #include <xite/binarize.h>

 int bin_nr( double sdev_limit,
    double mean_limit, double min_ratio,
    double max_ratio, double valley_to_peak,
    int region_size, IBAND inband,
    IBAND outband );

Description

The input band inband is binarized using the method of Nakagawa and Rosenfeld. The method is a slight modification of Chow and Kaneko`s method. The result is returned in outband.

This method calculates a thresholding surface. The image is divided into windows of size (region_size x region_size), and the histograms for each window are tested for bimodality. Each histogram is approximated by a mixture of two Gaussian distributions. Let mu1 and mu2 be the estimated mean values, and sigma1 and sigma2 be the estimated standard deviations of the two distributions. Also, let sigma_tot be the total standard deviation, and vtp be the valley-to-peak ratio. The bimodality test requires the following five criteria to hold:

(1) sigma_tot > sdev_limit

(2) mu2 - mu1 > mean_limit

(3) sigma1/sigma2 > min_ratio

(4) sigma1/sigma2 > min_ratio

(5) vtp < valley_to_peak_limit

For each bimodal window, a threshold is calculated based on the mu_1, mu_2, sigma_1 and sigma_2 parameters of the mixture distribution.

Thresholds for the other windows are calculated on basis of the thresholds for the bimodal windows. The thresholds are first smoothed, and then interpolated to give a threshold surface, having a single threshold value for each image pixel. The image is binarized using the threshold surface.

Restrictions

inband and outband must have pixel type unsigned byte.

See also

binarize(1)

References

[1] C.K. Chow & T. Kaneko
"Automatic detection of the left ventricle from cineangiograms", Computers and biomedical research, vol. 5, pp 388-410, 1972.

[2] Yasuo Nakagawa & Azriel Rosenfeld
"Some experiments on variable thresholding", Pattern Recognition, vol 11, no 3, pp 191-204, 1979.

Return value

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

Files

src/binarize/bin_nr.c

Author

Řivind Due Trier

Id

$Id: bin_nr.c,v 1.15 1997/01/14 15:46:55 svein Exp $