Page 166 -
P. 166
140 Chapter 4 ■ Grey-Level Segmentation
There are many ways to do this, but a simple one is to convolve the image
with the mask:
0 1 0
0 −41
0 1 0
Now a histogram of the original image is found considering only those pixels
having large Laplacians; those in the 85th percentile and above will do nicely.
Those pixels having a Laplacian greater than 85% of their peers will have their
grey level appear in the histogram, whereas all other pixels will not. Now the
threshold is selected using the histogram thus computed.
Using a better approximation to the Laplacian should give better results,
but in many cases this simple procedure will show an improvement over the
previous methods. The C program on the website that computes a threshold
using this method is called thrlap.c, and requires that the user enter the
percentage value used to select the Laplacian values.
4.1.2 Iterative Selection
Iterative selection is a process in which an initial guess at a threshold is refined
by consecutive passes through the image [Ridler, 1978]. It does not use the his-
togram directly, but instead thresholds the image into object and background
classes repeatedly, using the levels in each class to improve the threshold.
The initial guess at the threshold is simply the mean grey level. This
threshold is then used to collect statistics on the black and white regions
obtained; the mean grey level for all pixels below the threshold is found (i.e.,
the black pixels) and called t b , and the mean level of the pixels greater than or
equal to the initial threshold (the white pixels) is called t o . Now a new estimate
of the threshold is computed as (t b + t o )/2, or the average of the mean levels
in each pixel class, and the process is repeated using this threshold. When no
change in threshold is found in two consecutive passes through the image, the
process is stopped.
This is designed to work well in a hardware implementation, in which
the initial estimate of a threshold assumes that the four corners of the image
correspond to background regions and the rest of the image is used as an
estimate of the object grey levels. However, in a software implementation the
same threshold can be computed using the histogram rather than scanning
the entire image during each iteration. This should be faster, since the his-
togram is a one-dimensional array of a fixed small size.