Page 133 -
P. 133

Chapter 3 ■ Digital Morphology   107


                                00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0
                                00 0  0 0  1  1 1  1  1 0  0  0 0 0  00 0  0 0  1  1 1  1  1 0  0  0 0 0  00 0  0 0  3  3 3  3  3 0  0  0 0 0
                                00 0  1 1  1  2 2  2  1 1  1  0 0 0  00 0  1 1  1  2 2  2  1 1  1  0 0 0  00 0  3  3 3  3  3  0 0 0
                                00 1  1 2  2  2 2  2  2 2  1  1 0 0  00 1  1 2  2  2 .  2  2 2  1  1 0 0  00  3  3 .  3  3  0 0
                                00 1  2 2  3  3 3  3  3 2  2  1 0 0  00 1  2 2  3  3 3  3  3 2  2  1 0 0  00  3  3 3  3  3  0 0
                                01 1  2 3  3  4 4  4  3 3  2  1 1 0  01 1  2 3  3  4 4  4  3 3  2  1 1 0  03 3  3 3  3  3 3  3  3 3  3  3 3 0
                                01 2  2 3  4  4 5  4  4 3  2  2 1 0  01 2  2 3  4  4 .  4  4 3  2  2 1 0  03 3  3 3  3  3 .  3  3 3  3  3 3 0
                                01 2  3 3  4  5 5  5  4 3  3  2 1 0  01 2  . 3  4  . .  .  4 3  .  2 1 0  03 3  . 3  3  . .  .  3 3  .  3 3 0
                                01 2  2 3  4  4 5  4  4 3  2  2 1 0  01 2  2 3  4  4 .  4  4 3  2  2 1 0  03 3  3 3  3  3 .  3  3 3  3  3 3 0
                                01 1  2 3  3  4 4  4  3 3  2  1 1 0  01 1  2 3  3  4 4  4  3 3  2  1 1 0  03 3  3 3  3  3 3  3  3 3  3  3 3 0
                                00 1  2 2  3  3 3  3  3 3  2  2 0 0  00 1  2 2  3  3 3  3  3 3  2  2 0 0  00  3  3 3  3  3  0 0
                                00 1  1 2  2  2 3  2  2 2  1  1 0 0  00 1  1 2  2  2 .  2  2 2  1  1 0 0  00  3  3 .  3  3  0 0
                                00 0  1 1  1  2 2  2  1 1  1  0 0 0  00 0  1 1  1  2 2  2  1 1  1  0 0 0  00 0  3  3 3  3  3  0 0 0
                                00 0  0 0  1  1 1  1  1 0  0  0 0 0  00 0  0 0  1  1 1  1  1 0  0  0 0 0  00 0  0 0  1  1 1  1  1 0  0  0 0 0
                                00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0
                                          (a)                     (b)                      (c)
                                00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0
                                00 0  0 0      0  0  0 0 0  00 0  0 0  3  3 3  3  3 0  0  0 0 0
                                00 0  5 5  5  5 5  5  5 5  5  0 0 0  00 0  5 5  5  5 5  5  5 5  5  0 0 0
                                00 5  5 5  5  5 .  5  5 5  5  5 0 0  00 5  5 5  5  5 5  5  5 5  5  5 0 0
                                00 5  5 5  5  5 5  5  5 5  5  5 0 0  00 5  5 5  5  5 5  5  5 5  5  5 0 0
                                0  5  5 5  5  5 5  5  5 5  5  5  0  03 5  5 5  5  5 5  5  5 5  5  5 3 0
                                0  5  5 5  5  5 .  5  5 5  5  5  0  03 5  5 5  5  5 5  5  5 5  5  5 3 0
                                0  5  . 5  5  . .  .  5 5  .  5  0  03 5  5 5  5  5 5  5  5 5  5  5 3 0
                                0  5  5 5  5  5 .  5  5 5  5  5  0  03 5  5 5  5  5 5  5  5 5  5  5 3 0
                                0  5  5 5  5  5 5  5  5 5  5  5  0  03 5  5 5  5  5 5  5  5 5  5  5 3 0
                                00 5  5 5  5  5 5  5  5 5  5  5 0 0  00 5  5 5  5  5 5  5  5 5  5  5 0 0
                                00 5  5 5  5  5 .  5  5 5  5  5 0 0  00 5  5 5  5  5 5  5  5 5  5  5 0 0
                                00 0  5 5  5  5 5  5  5 5  5  0 0 0  00 0  5 5  5  5 5  5  5 5  5  0 0 0
                                00 0  0 0      0  0  0 0 0  00 0  0 0  3  3 3  3  3 0  0  0 0 0
                                00 0  0 0  0  0 0  0  0 0  0  0 0 0  00 0  0 0  0  0 0  0  0 0  0  0 0 0
                                          (d)                     (e)                      (f)
                               Figure 3.15: Multiple closings for outline smoothing. (a) Glyph from Figure 3.12a after
                               a depth 2 closing. (b) After a depth 3 closing. (c) A chess piece. (d) Thresholded chess
                               piece showing irregularities in the outline and some holes. (e) Chess piece after closing.
                               (f) Chess piece after a depth 2 closing.

                                 Figure 3.16 is a sample reservoir rock pore image having a size of 300x300
                               pixels. The results of opening using the distance encoded image are identical
                               with the results from the traditional erode-dilate method, although all openings
                               were found in only three passes through the image. Two sample openings
                               are shown, with the deleted pixels shown in grey. The roughness spectrum
                               can be calculated by repeatedly thresholding the image and counting the
                               pixels remaining after each step, but there is an easier way. The roughness
                               spectrum can now be found by simply computing the grey-level histogram of
                               the globally opened image.


                               3.3.6 MAX—A High-Level Programming Language
                               for Morphology

                               Many of the tools needed for experimenting with morphology are provided
                               in this chapter and on the accompanying website in the form of C func-
                               tions and procedures. However, their use requires a certain fluency in the
                               C language, and any given experiment may involve a sequence of compi-
                               lation/test/debug steps that can be time consuming. To avoid this, and to
   128   129   130   131   132   133   134   135   136   137   138