Morphology
• Morphology deals with form and structure
• Mathematical morphology is a tool for extracting image components useful in:– representation and description of region shape
(e.g. boundaries)– pre- or post-processing (filtering, thinning,
etc.)• Based on set theory
Morphology
• Sets represent objects in images• Sets in binary images (x,y)• Sets in gray scale images (x,y,g)• Some morphological operations:
Dilation & ErosionOpening & Closing
Hit-or-Miss TransformBasic Algorithms
Basic Concepts of Set Theory• A is a set in , a=(a1,a2) an element of A, aA• If not, then aA : null (empty) set• Typical set specification: C={w|w=-d, for d D}• A subset of B: AB• Union of A and B: C=AB• Intersection of A and B: D=AB• Disjoint sets: AB= • Complement of A:• Difference of A and B: A-B={w|w A, w B}=• Reflection of B: • Translation of A by z=(z1,z2):
€
Z 2
€
Ac = {w | w ∉ A}
€
A ∩ Bc
€
ˆ B = {w | w = −b,b∈ B}
€
(A)z = {c | c = a + z,a∈ A}
Morphological Image Processing
Morphological Image Processing
Morphological Image Processing
Dilation & Erosion
• Basic definitions:
– A,B: sets in Z2 with components a=(a1,a2) and b=(b1,b2)
– Translation of A by x=(x1,x2), denoted by (A)x is defined as:
(A)x = {c| c=a+x, for a∈A}
Dilation & Erosion
• More definitions:
Reflection of B: = {x|x=-b, for b∈B}
Complement of A: Ac = {x|xA}
Difference of A & B: A-B = {x|x∈A, x B} = A∩Bc
B̂
Dilation & Erosion
• Dilation: : empty set; A,B: sets in Z2
– Dilation of A by B:
€
A ⊕B = {x | ( ˆ B )x ∩ A ≠ ∅}
Dilation & Erosion
• Dilation:– Obtaining the reflection of B about its origin
and then shifting this reflection by x
– The dilation of A by B then is the set of all x displacements such that and A overlap by at least one nonzero element…
B̂
Dilation & Erosion
• Dilation:
}])ˆ[(|{ AABxBA x ⊆∩=⊕
B is the structuring element in dilation.
Morphological Image Processing
Morphological Image Processing
Dilation & Erosion
• Erosion:
i.e. the erosion of A by B is the set of all points xsuch that B, translated by x, is contained in A.
In general:BABA cc ˆ) ( ⊕=
})(|{ ABxBA x ⊆=
Morphological Image Processing
Morphological Image Processing
Opening & Closing
• In essence, dilation expands an image and erosion shrinks it.
• Opening:– generally smoothes the contour of an image,
breaks isthmuses, eliminates protrusions.
• Closing:– smoothes sections of contours, but it
generally fuses breaks, holes, gaps, etc.
Opening & Closing
• Opening of A by structuring element B:
BBABA ⊕= ) (o
• Closing:
BBABA )( ⊕=•
Morphological Image Processing
Morphological Image Processing
Morphological Image Processing
Morphological Image Processing