Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.

Similar presentations


Presentation on theme: "1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng."— Presentation transcript:

1 1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng Chapter 10: Mathematical Morphology

2 2 © 2010 Cengage Learning Engineering. All Rights Reserved. 10.1 Introduction Morphology is a branch of image processing that is particularly useful for analyzing shapes in images We will develop basic morphological tools for investigation of binary images and then show how to extend these tools to grayscale images Ch10-p.267

3 3 10.2 Basic Ideas © 2010 Cengage Learning Engineering. All Rights Reserved. 10.2.1 Translation Ch10-p.267

4 4 FIGURE 10.2 © 2010 Cengage Learning Engineering. All Rights Reserved. 10.2.2 Reflection Ch10-p.268

5 5 10.3 Dilation and Erosion © 2010 Cengage Learning Engineering. All Rights Reserved. 10.3.1 Dilation A and B are sets of pixels Also known as Minkowski addition Ch10-p.269

6 6 FIGURE 10.3 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.270

7 7 FIGURE 10.4 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.271

8 8 FIGURE 10.5 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.271

9 9 10.3 Dilation and Erosion © 2010 Cengage Learning Engineering. All Rights Reserved. 10.3.1 Erosion Ch10-p.272

10 10 FIGURE 10.7 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.274

11 11 FIGURE 10.8 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.272

12 12 10.3 Dilation and Erosion © 2010 Cengage Learning Engineering. All Rights Reserved. RELATIONSHIP BETWEEN EROSION AND DILATION Ch10-p.274

13 13 10.3 Dilation and Erosion © 2010 Cengage Learning Engineering. All Rights Reserved. 10.3.3 An Application: Boundary Detection If A is an image and B a small structuring element Ch10-p.275

14 14 FIGURE 10.9 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.276

15 15 FIGURE 10.10 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.277

16 16 FIGURE 10.11 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.277

17 17 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. 10.4.1 Opening (function: imopen ) Ch10-p.278

18 18 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. (A ◦ B) ⊆ A. Note that this is not the case with erosion. As we have seen, an erosion may not necessarily be a subset (A ◦ B) ◦ B = A ◦ B. That is, an opening can never be done more than once (idempotence) If A ⊆ C, then (A ◦ B) ⊆ (C ◦ B) Opening tends to smooth an image, to break narrow joins, and to remove thin protrusions Ch10-p.279

19 19 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. 10.4.2 Closing (function: imclose ) Ch10-p.279

20 20 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. A ⊆ (A B) (A B) B = A B; that is, closing, like opening, is idempotent If A ⊆ C, then (A B) ⊆ (C B) Closing also tends to smooth an image, but it fuses narrow breaks and thin gulfs and eliminates small holes Ch10-p.279

21 21 FIGURE 10.14 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.282

22 22 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. AN APPLICATION: NOISE REMOVAL Morphological filtering Ch10-p.282

23 23 FIGURE 10.15 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.282

24 24 10.4 Opening and Closing © 2010 Cengage Learning Engineering. All Rights Reserved. RELATIONSHIP BETWEEN OPENING AND CLOSING see Haralick and Shapiro [11] for a formal proof Ch10-p.283

25 25 10.5 The Hit-or-Miss Transform © 2010 Cengage Learning Engineering. All Rights Reserved. B is the square structuring element A Ch10-p.283

26 26 FIGURE 10.17 & 18 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.284

27 27 FIGURE 10.19 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.285

28 28 10.5 The Hit-or-Miss Transform © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.285

29 29 FIGURE 10.20 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.286

30 30 10.6 Some Morphological Algorithm © 2010 Cengage Learning Engineering. All Rights Reserved. 10.6.1 Region Filling Ch10-p.286

31 31 © 2010 Cengage Learning Engineering. All Rights Reserved. Given a pixel p within the region, we wish to fill up the entire region we start with p and dilate as many times as necessary with the cross-shaped structuring element B 10.6 Some Morphological Algorithm Ch10-p.286

32 32 FIGURE 10.22 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.287

33 33 © 2010 Cengage Learning Engineering. All Rights Reserved. 10.6.2 Connected Components 10.6 Some Morphological Algorithm Ch10-p.287

34 34 FIGURE 10.24 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.289

35 35 FIGURE 10.25 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.289

36 36 FIGURE 10.26 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.290

37 37 FIGURE 10.27 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.291

38 38 © 2010 Cengage Learning Engineering. All Rights Reserved. 10.6.3 Skeletonization Ch10-p.291 10.6 Some Morphological Algorithm

39 39 FIGURE 10.28 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.292

40 40 FIGURE 10.28 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.292

41 41 FIGURE 10.29 © 2010 Cengage Learning Engineering. All Rights Reserved. This method of skeletonization is called Lantuéjoul’s method. For details see Serra [33] Ch10-p.291

42 42 FIGURE 10.30 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.292

43 43 FIGURE 10.31 © 2010 Cengage Learning Engineering. All Rights Reserved. Square-structuring elementCross-structuring element Ch10-p.293

44 44 10.7 A Note on M ATLAB ’s bwmorph Function © 2010 Cengage Learning Engineering. All Rights Reserved. Based on lookup tables (ch11) Consider the 3 × 3 neighborhood of a pixel Since each pixel in the neighborhood can have only two values, there are 2 9 = 512 different possible neighborhoods Define a morphological operation to be a function that maps these neighborhoods to the values 0 and 1 Ch10-p.294

45 45 © 2010 Cengage Learning Engineering. All Rights Reserved. 10.7 A Note on M ATLAB ’s bwmorph Function Each possible neighborhood state can be associated with a numeric value from 0 (all pixels have value 0) to 511 (all pixels have value 1) The lookup table is then a binary vector of length 512. Its k th element is the value of the function for state k Many other operations can be defined by this method (see the help file for bwmorph ) Ch10-p.294

46 46 10.8 Grayscale Morphology © 2010 Cengage Learning Engineering. All Rights Reserved. Erosion 1. Find the 3 × 3 neighborhood N p of p 2. Compute the matrix N p − B 3. Find the minimum of that result p Np Ch10-p.295

47 47 10.8 Grayscale Morphology © 2010 Cengage Learning Engineering. All Rights Reserved. Dilation 1. Find the 3 × 3 neighborhood N p of p 2. Compute the matrix N p + B 3. Find the maximum of that result Summary Ch10-p.295

48 48 FIGURE 10.33 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.297

49 49 10.8 Grayscale Morphology © 2010 Cengage Learning Engineering. All Rights Reserved. The arbitrary parameter of strel allows us to create a structuring element containing any values we like ones(3,3) provides the neighborhood; the second matrix provides the values Ch10-p.299

50 50 10.8 Grayscale Morphology © 2010 Cengage Learning Engineering. All Rights Reserved. for dilation Ch10-p.300

51 51 FIGURE 10.34 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.301

52 52 FIGURE 10.35 © 2010 Cengage Learning Engineering. All Rights Reserved. OPENING AND CLOSING Ch10-p.301

53 53 10.9 Applications of Grayscale Morphology © 2010 Cengage Learning Engineering. All Rights Reserved. 10.9.1 Edge Detection morphological gradient Ch10-p.302

54 54 FIGURE 10.36 © 2010 Cengage Learning Engineering. All Rights Reserved. Ch10-p.303

55 55 FIGURE 10.37 © 2010 Cengage Learning Engineering. All Rights Reserved. Noise Removal Ch10-p.303


Download ppt "1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng."

Similar presentations


Ads by Google