Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Image Processing Lecture 19: Segmentation: Morphological Watersheds Prof. Charlene Tsai.

Similar presentations


Presentation on theme: "Digital Image Processing Lecture 19: Segmentation: Morphological Watersheds Prof. Charlene Tsai."— Presentation transcript:

1 Digital Image Processing Lecture 19: Segmentation: Morphological Watersheds Prof. Charlene Tsai

2 2 Introduction Review: We have done  Detection of discontinuities  Thresholding  Region processing Morphological watersheds embodies properties from other 3 approaches, therefore more superior.

3 3 Basic Concept Water level a c c b Visualize the image in 3D topography ( 地勢 )  2 spatial coordinates + graylevel 3 types of points:  (a) Points in a regional minimum  (b) Points on hills  (c) Points on watershed lines How to differentiate (b) & (c)?

4 4 Illustration Objective: finding the watershed lines  Construction of dam to prevent catchment basins from merging Original imageTopographic view Catchment basins Watershed lines

5 5 (con’d) Punch a hole in each regional minimal for water to fill up the catchment basin.

6 6 (con’d) Water start merging, so shorter dam constructed Longer dam constructed Final result

7 7 Aside Watershed algorithm is often applied to the gradient of an image, rather than to the image itself.  Regional minima of catchment basins correlate nicely with the small value of the gradient corresponding the objects of interest  Boundaries are highlighted as the watershed lines.

8 8 Watershed Segmentation Algorithm Starting with the notation:  g(x,y) is the image with min and max the lowest and highest graylevel, respectively  M 1, M 2, … M R be the regional minima  T[n]={ (s,t) | g(s,t)<n }  C n (M i ) is the set of (s,t) in the catchment basin of M i that are flooded at stage n.  C[n-1] is a subset of C[n] and C[n] is subset of T[n]. So it implies that  Each connected component (CC) of C[n-1] is contained in exactly one CC of T[n].

9 9 Flooding Initialization: C[min+1]=T[min+1] Obtain C[n] from C[n-1] (recursively):  Let Q be the set of CC in T[n], and  3 possibilities for : (a) empty (b) containing one CC of C[n-1] (c) containing more than one CC of C[n-1]

10 10 Constructing C[n] Scenario (a) [empty]: a new minimum is found  q is incorporated into C[n-1] to form C[n] Scenario (b) [containing 1 CC]: q lies in the catchment basin of some regional minimum  q is incorporated into C[n-1] to form C[n] Scenario (c) [containing 1+ CC], part of the watershed line is encountered.  A dam must be build within q to prevent overflow between the catchment basins.

11 11 Dam Construction of height max+1 In C[n-1] q Scenario (c)

12 12 B (con’d) Dilate each CC of by the structuring element B, subject to 2 conditions:  Dilation constrained to q (origin of B located in q)  Dilation cannot cause merging of CC’s being dilated Change the height to max+1

13 13 Example Gradient image Segmente d image

14 14 Exercise Give a step-by-step implementation of the dam building procedure for the one- dimensional gray-level cross section shown. Show a drawing of the cross section at each step, showing “water” levels and dams constructed. g(x) x

15 15 Step1 (n=1): T[1]=? C[1]=? Q[1]=?

16 16 Step2 (n=2): T[2]=? Q[2]=? C[2]=?

17 17 Step3 (n=3,4): T[3]=? Q[3]=? C[3]=? C[4]=?

18 18 Step5 (n=5): T[5]=? Q[5]=? C[5]=?

19 19 Dam Construction:


Download ppt "Digital Image Processing Lecture 19: Segmentation: Morphological Watersheds Prof. Charlene Tsai."

Similar presentations


Ads by Google