thresLloyd

[ XITE Reference Manual | XITE home ]

Name

thresLloyd - threshold by the method of Lloyd

Syntax

 #include <xite/threshold.h>

 int thresLloyd( histogram h );

Description

thresLloyd calculates the threshold value by using the method of Lloyd, 1985. Initially, the threshold value is set to the average brightness. Then, iteratively, the threshold is set to the average of the mean of the pixels below the threshold, and the mean of the pixels above the threshold , PLUS a compensation factor depending on the varince of the distribution. When the threshold value remains constant, iteration terminates.

The actual thresholding is not performed, see the routine "threshold".

Restrictions

Return value

The threshold value. Pixel values up to, and including, the return value, is below the threshold.

Author

Tor L|nnestad, BLAB, ifi, UiO

Id

$Id: thresLloyd.c,v 1.17 1996/11/08 14:06:06 svein Exp $