You are on page 1of 22
MORPHOLOGICAL IMAGE PROCESSING WHAT WILL WE LEARN? * What is mathematical morphology and how is it used in image processing? © What are the main morphological operations and what is the effect of applying them to binary and grayscale images? * What is a structuring element (SE) and how does it impact the result of a mor- phological operation? * What are some of the most useful morphological image processing algorithms? » @ FIGURE 15. Test images for segmentation algrithns: (a) SUG TSR and () is grayscale equalent:() SIAL (courtesy of Maier) and (he result of ‘morphological preprocessing and thresholding. Mathematical morphology is a branch of image processing that has been successfully used to provide tools for representing, describing, and analyzing shapes in images. morphological algorithms have been used for pre- or postprocessing the images con- taining shapes of interest. The basic principle of mathematical morphology is the extraction of geometrical and topological information from an unknown set (an image) through transformations using another, well-defined, set known as Structuring element, In morphological image processing, the design of SEs, their shape and size, is crucial to the success of the morphological operations that use them. 13.2. FUNDAMENTAL CONCEPTS AND OPERATIONS The basic concepts of mathematical morphology can be introduced with the help of set theory and its standard operations: union (U), intersection (TN), and complement, Classical image processing refers to a binary image as a function of x and y, whose only possible values are 0 and 1. The statement C = AM B, from a set theory perspective, means C = {(x, y)i@, y) € A and (x, y) € B} The equivalent expression using conventional image processing notation would be (13.6) COE 1 if A(x, y) and B(x, y) are both 1 “2710. otherwise set A; set A and its complement A*; translation of A by x = (x1, x2); reflection of B; @ ge set difference (A—B). @ representative results for two binary input images. Pa = U] In MATLAB MATLAB's IPT provides a function for creating structuring elements, stre1, which supports arbitrary shapes, as well as commonly used ones, such as square, diamond, line, and disk. The result is stored as a variable of class stre1. (@) (b) FIGURE 13.3 Examples of structuring elements: (a) square; (b) cross. strel(’square’,4) sel = Flat STREL object containing 16 neighbors. Decomposition: 2 STREL objects containing a total of 8 neighbors Neighborhood: 1 1 1 1 1 1 1 1 DILATION AND EROSION Dilation is a morphological operation whose effect is tol" grow” Jor “thicken” objects in a binary image. The extent and direction of this thickening are controlled by the size and shape of the structuring element. Mathematically, the dilation of a set A by B, denoted A @ B, is defined as A@B= {x\(B). 0A ¢H} (13.7) In MATLAB Morphological dilation is implemented by function im@iWalee) which takes two parameters: an image and a structuring element. Example of dilation using three different rectangular structuring elements. 4 a > | |) 408 B=B L ‘ a = ~ oO B-B ‘ a > o B=B Erosion Erosion Erosion is a morphological operation whose effect is to “shrink” or “thin” objects in a binary image. The direction and extent of this thinning is controlled by the shape and size of the structuring element. Mathematically, the erosion of a set A by B, denoted A © B, is defined as A Ob-42(D, OR =O? Morphological erosion is implemented by function iimi€%6ae) which takes two pa- rameters: an image and a structuring element. Example of erosion using three different rectangular structuring elements. a nl ~ & uv &> AGB a co > (AG BY =A°® (13.9) A® (AS 6 By (13.10) Erosion and dilation can also be interpreted in terms of whether a SE hits or fits an image (region), as follows For dilation the resulting image g(x, y), given an input image f(x, y) and a SE se, will be glx, y) = {| (13.11) for all x and y. For 6f0sion, the resulting image g(x, y), given an input image f(x, y) anda SE se, will be v= { An for all x and y. COMPOUND OPERATIONS In this section, we present morphological operations that combine the two fundamen- tal operations (erosion and dilation) in different ways. 13.4.1 Opening The morphological opening of set A by B, represented as A o B, is the erosion of A by B followed by the dilation of the result by B. Mathematically, AcB=(AOB)OB (13.13) The opening operation is {demipoteHit, that is, once an image has been opened with a certain SE, subsequent applications of the opening algorithm with the same SE will not cause any effect on the image. Mathematically, (Ao B)oB=AoB (13.15) Morphological opening is typically used to remove thin protrusions from objects and to open up a gap between objects connected by a thin bridge without shrinking the objects (as erosion would have done). It also causes a smoothening of the object’s contour Example of morphological opening. ‘Morphological opening is implemented by function S05) AGB AB =( ASB)®B Closing The morphological closing of set A by B, represented as A e B, is the dilation of A by B followed by the erosion of the result by B. Mathematically, AeB=(ASB)OB (13.16) Just as with opening, the closing operation is idempotent, that is, once an image has been closed with a certain SE, subsequent applications of the opening algorithm with the same SE will not cause any effect on the image. Mathematically, (AeB)eB=AeB Morphological closing is typically used to fill small holes, fuse narrow breaks, and close thin gaps in the objects within an image, without changing the objects’ size (as dilation would have done). It also causes a smoothening of the object's contour AeB=(A@B)OB _— ks is _ pruning Pe | ia removing interior pixels from (a) ri thinning the i in (e). thickening the image in (d); inning the image in (e)

You might also like