Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gray-Scale Morphological Filtering Generalization from binary to gray level Use f(x,y) and b(x,y) to denote an image and a structuring element Gray-scale.

Similar presentations


Presentation on theme: "Gray-Scale Morphological Filtering Generalization from binary to gray level Use f(x,y) and b(x,y) to denote an image and a structuring element Gray-scale."— Presentation transcript:

1 Gray-Scale Morphological Filtering Generalization from binary to gray level Use f(x,y) and b(x,y) to denote an image and a structuring element Gray-scale dilation of f by b –(f ⊕b)(s,t)=max{f(s-x,t-y)+b(x,y)|(s-x), (t-y)  D f and (x,y)  D b } –D f and D b are the domains of f and b respectively –(f ⊕b) chooses the maximum value of (f+ ) in the interval defined by, where is structuring element after rotation by 180 degree ( ) Similar to the definition of convolution with –The max operation replacing the summation and –Addition replacing the product b(x,y) functions as the mask in convolution –It needs to be rotated by 180 degree first

2 Gray-Scale Dilation Illustrated in 1D – (f ⊕b)(s)=max{f(s-x)+b(x)|(s-x)  D f and x  D b } f(x) with slope 1 x x A a b(x) s {f(s 1 -x)+b(x)| )|(s-x)  D f and x  [-a/2,a/2]} A s1s1 max{f(s 1 -x)+b(x)| )|(s-x)  D f and x  [-a/2,a/2]} =f(s 1 +a/2)+b(-a/2)= f(s 1 +a/2)+A=f(s 1 )+a/2+A s A f ⊕ b A+a/2

3 Flat Gray Scale Dilation In practice, gray-scale dilation is performed using flat structuring element –b(x,y)=0 if (x,y)  D b ; otherwise, b(x,y) is not defined –In this case, D b needs to be specified as a binary matrix with 1s being its domain –(f ⊕b)(x,y)=max{f(x-x’,y-y’), (x’,y’)  D b } –It is the same as the “max” filter in order statistic filtering with arbitrarily shaped domain –D b can be obtained using strel function as in binary dilation case

4 Flat Gray-Scale Dilation (f ⊕b)(s)=max{f(s-x)| x  D b } f(x) with slope 1 x x A a DbDb s f ⊕ b 1

5 Effects of Gray-Scale Dilation Depending on the structuring element adopted If all the values are non-negative (including flat gray scale dilation), the resulting image tends to be brighter Dark details are either reduced or eliminated –Wrinkle removal

6 Gray-Scale Erosion Gray-scale erosion of f by b –(f ⊖b)(s,t)=min{f(s+x,t+y)-b(x,y)|(s+x), (t+y)  D f and (x,y)  D b } –D f and D b are the domains of f and b respectively –(f ⊖b) chooses the minimum value of (f-b) in the domain defined by the structuring element

7 Gray-Scale Erosion (f ⊖b)(s)=min{f(s+x)-b(x)|(s+x)  D f and x  D b } f(x) with slope 1 x x A a b(x) s {f(s 1 +x)-b(x)| )|(s+x)  D f and x  [-a/2,a/2]} A s1s1 min{f(s 1 +x)-b(x)| )|(s+x)  D f and x  [-a/2,a/2]} =f(s 1 -a/2)-b(-a/2)= f(s 1 -a/2)-A= f(s 1 )-a/2-A s A+a/2 f ⊖ b

8 Flat Gray Scale Erosion In practice, gray-scale erosion is performed using flat structuring element –b(x,y)=0 if (x,y)  D b ; otherwise, b(x,y) is not defined –In this case, D b needs to be specified as a binary matrix with 1s being its domain –(f ⊖b)(x,y)=min{f(x+x’,y+y’), (x’,y’)  D b } –It is the same as the “min” filter in order statistic filtering with arbitrarily shaped domain –D b can be obtained using strel function as in binary case

9 Effects of Gray-Scale Erosion Depending on the structuring element adopted If all the values are non-negative (including flat gray scale dilation), the resulting image tends to be darker Bright details are either reduced or eliminated

10 Examples Reduced Eliminated Reduced Eliminated

11 Dual Operations Gray-scale dilation and erosion are duals with respect to function complementation and reflection – ⊖ –It means dilation of a bright object is equal to erosion of its dark background

12 Gray-Scale Opening and Closing The definitions of gray-scale opening and closing are similar to that of binary case –Both are defined in terms of dilation and erosion Opening (erosion followed by dilation) –A◦b=(A ⊖ b) ⊕b Closing (dilation followed by erosion) –Ab=(A ⊕ b) ⊖b Again, opening and closing are dual to each other with respect to complementation and reflection –

13 Geometric Interpretation

14 Properties of Gray-Scale Opening and Closing Opening 1.( f ◦ b )  f 2.If f 1  f 2, then (f 1 ◦ b)  (f 2 ◦ b ) 3.(f ◦ b )◦ b =f ◦ b Closing 1.f  ( f b ) 2.If f 1  f 2, then (f 1 b)  (f 2 b ) 3.(f b b) =f b The notation e  r is used to indicate that the domain of e is a subset of r and e(x,y)  r(x,y) The above properties can be justified using the the geometric interpretation of opening and closing shown previously

15 Example 9.31 (a) may be not correct

16 Applications of Gray-Scale Morphology Morphological smoothing –Opening (reduce bright details) followed by closing (reduce dark details) –Alternating sequential filtering Repeat opening followed by closing with structuring elements of increasing sizes A◦b 5 A◦b 5 b 5 Ab 2 ◦b 2 b 3 ◦b 3 b 4 ◦b 4 b 5 ◦b 5

17 Applications of Gray-Scale Morphology Morphological gradient –Effects of dilation (brighter) and erosion (darker) are manifested on edges of an image – g = (f ⊕b) - (f⊖b) can be used to bring out edges of an image

18 Applications of Gray-Scale Morphology Top-hat transform –Defined as h = f – (f◦b) –Useful for enhancing details in the presence of shading

19 Another Application of Top-Hat Transform Compensation for nonuniform background illumination


Download ppt "Gray-Scale Morphological Filtering Generalization from binary to gray level Use f(x,y) and b(x,y) to denote an image and a structuring element Gray-scale."

Similar presentations


Ads by Google