Page 167 -
P. 167

Chapter 4 ■ Grey-Level Segmentation    141


                                 Starting with the initial estimate of the threshold T 0 ,the kth estimate of the
                               threshold is [Thrussel, 1979]:
                                                                        N
                                                         T k − 1

                                                             i · h[i]
                                                          
                 j · h[j]
                                                          i = 0      j = T k−1 + 1
                                                    T k =          +                           (EQ 4.4)
                                                                          N
                                                           T k − 1
                                                          2  
  h[i]  2       h[j]
                                                           i = 0       j = T k−1 + 1
                               where h is the histogram of the grey levels in the image. Again, when
                               T k = T k+1 then T k is the proper threshold. This is the actual method used in
                               the C code for the program thris.c, which implements the iterative selection
                               algorithm.

                               4.1.3 The Method of Grey-Level Histograms

                               The thresholding methods based on selecting the low point between two
                               histogram peaks use the concept that object pixels and background pixels have
                               different mean levels, and are random numbers drawn from one of two normal
                               distributions. These distributions also have their own standard deviations and
                               variances, where variance is the square of the standard deviation.
                                 If there are two groups of pixels in the image, as suggested, then it is a
                               simple matter to compute the overall, or total, variance of the grey level values
                                                         2
                               in the image, denoted by σ t . For any given threshold t, it is also possible to
                               separately compute the variance of the object pixels and of the background
                                                                                              2
                               pixels; these represent the within-class variance values, denoted by σ w . Finally,
                               the variation of the mean values for each class from the overall mean of all
                                                                                               2
                               pixels defines a between-classes variance, which will be denoted by σ b This is
                               the beginning of a method in statistics called analysis of variance, but we will
                               not go too much further with it here. The important issue is that an optimal
                               (in some respects) threshold can be found by minimizing the ratio of the
                               between-class variance to the total variance [Otsu, 1979]; that is,
                                                                     σ 2
                                                               η(t) =  b                       (EQ 4.5)
                                                                     σ t 2
                               defines the needed ratio, and the value of t that gives the smallest value for
                                                            2
                               h is the best threshold. Since σ t is the overall variance it is easy to calculate
                               from the image, as is the overall mean µ T . The between class variance is
                               calculated by:
                                                            2
                                                           σ = ω 0 ω 1 (µ 0 µ 1 ) 2            (EQ 4.6)
                                                            b
   162   163   164   165   166   167   168   169   170   171   172