Page 258 - Digital Analysis of Remotely Sensed Imagery
P. 258

220    Cha pte r  S i x



                             r−1,c               r−1,c−1  r−1,c  r−1,c+1


                      r,c−1  r,c   r,c+1          r,c−1  r,c   r,c+1



                             r+1,c               r+1,c−1  r+1,c  r+1,c+1

                             (a)                         (b)
               FIGURE 6.11  Defi nition of neighborhood with a window size of 3 × 3 pixels
               for pixel (r, c) (shaded). (a) Four-connectivity neighborhood; (b) eight-
               connectivity neighborhood.

               matrix, often called kernel coefficients, serve to weigh pixels in calcu-
               lating the convoluted output. Different kernel values serve different
               filtering purposes.
                   The convolution of the kernel with the two-dimensional (2D)
               input image is essentially a matrix multiplication (Fig. 6.12). Since
               the kernel is square, the working window must also be square. The
               weights in the kernel dictate the influence of pixels in the corre-
               sponding position. This operation is mathematically expressed as

                                         d
                                           d
                                                  (,
                               DN   =  1  ∑ ∑  w  DN i j)            (6.8)
                                  out         ij     in
                                      W
                                         i =1 j =1
                                         d  d
                                     W = ∑∑  w ij                    (6.9)
                                         j=1  i=1
                                        245   233    247    274    344

                                       269    240    251    260    332
                 W 11  W 12  W 13
                 W 21  W 22  W 23       305   268    230    234    259
                 W 31  W 32  W 33       305   258    310    259    276


                                        331   218    454    386    557
                     (a)                            (b)

               FIGURE 6.12  The spatial convolution concept in image spatial fi ltering. (a) A
               3 × 3 kernel, or template, containing weights; (b) the array of pixel values in
               the input image (only partial) as shown in Fig. 1.3. The operation is based on
               moving window. After the boldfaced pixel is convoluted, the operation moves
               on toward the right by one pixel at a time.
   253   254   255   256   257   258   259   260   261   262   263