1 mathematic morphology used to extract image components that are useful in the representation and...

56
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction skeletons convex hull morphological filtering thinning pruning

Upload: joel-dickerson

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

3 Basic Set Theory

TRANSCRIPT

Page 1: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

1

Mathematic Morphology used to extract image components that are

useful in the representation and description of region shape, such as boundaries extraction skeletons convex hull morphological filtering thinning pruning

Page 2: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

2

Z2 and Z3

set in mathematic morphology represent objects in an image binary image (0 = white, 1 = black) : the

element of the set is the coordinates (x,y) of pixel belong to the object Z2

gray-scaled image : the element of the set is the coordinates (x,y) of pixel belong to the object and the gray levels Z3

Page 3: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

3

Basic Set Theory

Page 4: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

4

Reflection and Translation} ,|{ˆ Bfor bbwwB

} ,|{)( Afor azaccA z

Page 5: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

5

Logic Operations

Page 6: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

6

Example

Page 7: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

7

Dilation

}ˆ{ ΦA)Bz|(BA z

B = structuring element

Page 8: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

8

Dilation : Bridging gaps

Page 9: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

9

Erosion

}{ Az|(B)BA z

Page 10: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

10

Duality

BA

ABz

ABzBA

c

cz

ccz

c

ˆ})(|{

})(|{)(

cz

c ABzBA })(|{)(

BABA cc ˆ)(

Page 11: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

11

Erosion : eliminating irrelevant detail

structuring element B = 13x13 pixels of gray level 1

Page 12: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

12

Opening

BBABA )(})(|){( ABBBA zz

Page 13: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

13

Closing

BBABA )(

Page 14: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

14

Duality )ˆ()( BABA cc

PropertiesOpening(i) AB is a subset (subimage) of A(ii) If C is a subset of D, then C B is a subset of D B(iii) (A B) B = A B

Closing(i) A is a subset (subimage) of AB(ii) If C is a subset of D, then C B is a subset of D B(iii) (A B) B = A B

Page 15: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

15

Page 16: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

16

Page 17: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

17

Hit-or-Miss Transformation

)]([)( XWAXABA c

Page 18: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

18

Boundary Extraction

)()( BAAA

Page 19: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

19

Example

Page 20: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

20

Region Filling,...3,2,1 )( 1 kABXX c

kk

Page 21: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

21

Example

Page 22: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

22

Extraction of connected components

Page 23: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

23

Example

Page 24: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

24

Convex hull

i

iDAC

4

1)(

,...3,2,1 and 4,3,2,1 )( kiABXX iik

ik

Page 25: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

25

Page 26: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

26

Thinning

cBAA

BAABA

)(

)(

Page 27: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

27

Thickening)( BAABA

Page 28: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

28

SkeletonsK

kk ASAS

0)()(

))((0

kBASA k

K

k

Page 29: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

29

Page 30: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

30

Pruning}{1 BAX

AHXX )( 23

314 XXX

H = 3x3 structuring element of 1’s

)( 1

8

12k

kBXX

Page 31: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

31

Page 32: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

32

Page 33: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

33

Page 34: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

34

Page 35: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

35

5 basic structuring elements

Page 36: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

36

Extension to Gray-Scale images

deal with digital image function f(x,y) : the input image b(x,y) : a structuring element (a subimage

function) assumption : these functions are discrete

(x,y) are integers f and b are functions that assign a gray-level

value (real number or real integer) to each distinct pair of coordinate (x,y)

Page 37: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

37

Dilation• Df and Db are the domains of f and b, respectively

}),(;)(),(|),(),(max{),)((

bf DyxDytxsyxbtyxsftsbf

condition (s-x) and (t-y) have to be in the domain of f and (x,y) have to be in the domain of b is similar to the condition in binary morphological dilation where the two sets have to overlap by at least one element

Page 38: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

38

Dilation similar to 2D convolution

f(s-x) : f(-x) is simply f(x) mirrored with respect to the original of the x axis. the function f(s-x) moves to the right for positive s, and to the left for negative s.

max operation replaces the sums of convolution addition operation replaces with the products of

convolution general effect

if all the values of the structuring element are positive, the output image tends to be brighter than the input

dark details either are reduced or eliminated, depending on how their values and shapes relate to the structuring element used for dilation

Page 39: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

39

Erosion

}),(;)(),(|),(),(min{),)( (

bf DyxDytxsyxbtyxsftsbf

condition (s+x) and (t+y) have to be in the domain of f and (x,y) have to be in the domain of b is similar to the condition in binary morphological erosion where the structuring element has to be completely contained by the set being eroded

Page 40: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

40

Erosion similar to 2D correlation

f(s+x) moves to the left for positive s and to the right for negative s.

general effect if all the elements of the structuring element are

positive, the output image tends to be darker than the input

the effect of bright details in the input image that are smaller in area than the structuring element is reduced, with the degree of reduction being determined by the gray-level values surrounding the bright detail and by the shape and amplitude values of the structuring element itself

Page 41: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

41

Dual property gray-scale dilation and erosion are

duals with respect to function complementation and reflection.

),(ˆ and ),(

where),)(ˆ(),() (

yxbbyxff

tsbftsbf

c

cc

Page 42: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

42

Examplea b

cb) result of dilation

with a flat-top structuring element in the shape of parallelepiped of unit height and size 5x5 pixelsnote: brighter image and small, dark details are reduced

c) result of erosionnote: darker image and small, dark details are reduced

a) 512x512 original image

Page 43: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

43

Opening and closinga) a gray-scale scan

lineb) positions of rolling

ball for openingc) result of openingd) positions of rolling

ball for closinge) result of closing

bbfbfbbfbf )(

) (

view an image function f(x,y) in 3D perspective, with the x- and y-axes and the gray-level value axis

Page 44: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

44

Opening and closing properties

dual property opening operation satisfies

closing operation satisfies

bfbf cc ˆ)(

)()( )()()( then , if )(

)( )(

2121

bfbbfiiibfbfffii

fbfi

)()( )()()( then , if )(

)( )(

2121

bfbbfiiibfbfffii

bffi

note:note: er indicates that the domain of e is a subset of the domain of r, and also that e(x,y) ≤ r(x,y) for any (x,y) in the domain of e

Page 45: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

45

Effect of opening opening

the structuring element is rolled underside the surface of f all the peaks that are narrow with respect to the diameter

of the structuring element will be reduced in amplitude and sharpness

so, opening is used to remove small light details, while leaving the overall gray levels and larger bright features relatively undisturbed.

the initial erosion removes the details, but it also darkens the image.

the subsequent dilation again increases the overall intensity of the image without reintroducing the details totally removed by erosion

Page 46: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

46

Effect of closing closing

the structuring element is rolled on top of the surface of f

peaks essentially are left in their original form (assume that their separation at the narrowest points exceeds the diameter of the structuring element)

so, closing is used to remove small dark details, while leaving bright features relatively undisturbed.

the initial dilation removes the dark details and brightens the image

the subsequent erosion darkens the image without reintroducing the details totally removed by dilation

Page 47: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

47

Examples

Page 48: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

48

Some Applications of Gray-scale Morphology

Morphological smoothing

Morphological gradient

Top-hat transformation

Textural segmentation Granulometry Note: the examples shown in this topic are of size

512x512 and processed by using the structuring element in the shape of parallelepiped of unit height and size 5x5 pixels

Page 49: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

49

Morphological smoothing

perform an opening following by a closing effect: remove or attenuate both bright and dark

artifacts or noise

Page 50: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

50

Morphological gradient

effect: gradient highlight sharp gray-level transitions in the input image.

) ()( bfbfg

Page 51: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

51

Top-hat transformation

effect: enhancing detail in the presence of shading

note: the enhancement of detail in the background region below the lower part of the horse’s head.

)( bffh

Page 52: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

52

Textural segmentation

the region the right consists of circular blobs of larger diameter than those on the left.

the objective is to find the boundary between the two regions based on their textural content.

Page 53: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

53

Textural segmentation Perform

closing the image by using successively larger structuring elements than small blobs

as closing tends to remove dark details from an image, thus the small blobs are removed from the image, leaving only a light background on the left and larger blobs on the right

opening with a structuring element that is large in relation to the separation between the large blobs

opening removes the light patches between the blobs, leaving dark region on the right consisting of the large dark blobs and now equally dark patches between these blobs.

by now, we have a light region on the left and a dark region on the right, so we can use a simple threshold to yield the boundary between the two textural regions.

white black

Page 54: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

54

Granulometry

determining the size distribution of particles in an image.

from the example, the image consists of light objects of 3 different sizes

the objects are not only overlapping but also cluttered to enable detection of individual particles

Page 55: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

55

Granulometry objects are lighter than background Perform

opening with structuring elements of increasing size on the original image

the difference between the original image and its opening is computed after each pass when a different structuring element is completed

at the end of the process, these differences are normalized and then used to construct a histogram of particle-size distribution

idea: opening operations of a particular size have the most effect on regions of the input image that contain particles of similar size.

Page 56: 1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction

Homework Using color segmentation &

Morphological Operation, try to segment and count the number of faces in picture class1.jpg as precisely as you can:

ftp://doc.nit.ac.ir/Digital%20Image%20Processing/Benchmarks/ class1.jpg

56