morphological image processinganoop/dip/dip21full.pdfmorphological image processing anoopm....
TRANSCRIPT
DIP: Monsoon 2003
Morphological OperationsMorphological Operations
• Neighbourhood operations carried out in spatial domain
• Based on mathematical morphology
• set theoretical framework
• originally for binary images
• extended for grey scale images
• Applications:
• extract info about forms and structures
• shaping and filtering of forms and structures
DIP: Monsoon 2003
Morphological ProcessingMorphological Processing
• Consists essentially of two steps:
• Probe a given object in x[m,n] with a structuring element (se)
• Find how the se fits with the object
• Information about fit is used to
• extract info about the form of object; OR
• change pixel values and shape objects
• Different size & shape of se yields different kinds of info about the object; shapes the regions in different ways
DIP: Monsoon 2003
Set Theory BasicsSet Theory Basics
• Union, Intersection
• Complement, Difference
• Subset, Superset, Disjoint Sets
• Reflection:
• Translation:
},|{ˆ BbforbwwB ∈−==
},|{)( AaforzaccA z ∈+==
DIP: Monsoon 2003
ExamplesExamples
(A)z | z = (3,5)
A
(0,0)
-A
(0,0)
B
A - B
(3,5)
DIP: Monsoon 2003
Morphological Operations/AlgorithmsMorphological Operations/Algorithms
• Basic Morphological Operations
• Dilation
• Erosion
• Opening
• Closing
• Hit-or-Miss Transformation
• Morphological Algorithms
• Extensions to Grayscale
DIP: Monsoon 2003
DilationDilation
• Dilation of A by B: A⊕B
})ˆ(|{ Φ≠∩=⊕ ABzBA z }])ˆ[(|{ AABzBA z ⊆∩=⊕
x
x
A
B
B̂
A⊕B
x
x
x x
x
DIP: Monsoon 2003
Dilation: ExampleDilation: Example
DIP: Monsoon 2003
Dilation: ExampleDilation: Example010
111
010
DIP: Monsoon 2003
ErosionErosion
• Erosion of A by B: A B
A B = {z | (B)z ⊆ A}.
x
A
B
A⊕B
x
x
DIP: Monsoon 2003
Erosion: ExampleErosion: Example
DIP: Monsoon 2003
Erosion + DilationErosion + Dilation
DIP: Monsoon 2003
Opening and ClosingOpening and Closing
• Opening: Erosion followed by Dilation
• Opening A by B: A ○ B = (A B) ⊕ B
• Smoothes Contours, Breaks narrow bridges,
Eliminates thin protrusions
• Closing: Dilation followed by Erosion
• Closing A by B: A ● B = (A ⊕ B) B
• Smoothing, Closes small holes and channels
DIP: Monsoon 2003
Opening: Physical InterpretationOpening: Physical Interpretation
DIP: Monsoon 2003
Closing: Physical InterpretationClosing: Physical Interpretation
DIP: Monsoon 2003
Opening: ExampleOpening: Example
.
B
Erosion Dilation
DIP: Monsoon 2003
Closing: ExampleClosing: Example
.
B
ErosionDilation
DIP: Monsoon 2003
ExampleExample111
111
111
⊕⊕⊕⊕
⊕⊕⊕⊕
DIP: Monsoon 2003
Interesting PointsInteresting Points
• A ○B is a subset of A.
• If C ⊆ D; then C ○B ⊆ D ○B.
• (A ○B) ○B = A ○B.
• A is a subset of A ●B.
• If C ⊆ D; then C ●B ⊆ D ●B.
• (A ●B) ●B = A ●B.
DIP: Monsoon 2003
Hit-or-Miss Transform (HMT)Hit-or-Miss Transform (HMT)
• To detect an object in an image:
• Basic Idea:
• Use the object as se for erosion of A and
detect possible fits.
• Use the neighborhood of the object as
se for erosion of Ac and find over fits.
• Combine the two to detect exact fits.
DIP: Monsoon 2003
HMT: ExampleHMT: Example
DIP: Monsoon 2003
Morphological AlgorithmsMorphological Algorithms
• Boundary Extraction
• Region Filling
• Connected Components
• Convex Hull
• Thinning
• Thickening
• Skeletonization
• Pruning
DIP: Monsoon 2003
Boundary ExtractionBoundary Extraction
• Boundary of A is computed as:
β(A) = A - (A B)
B
DIP: Monsoon 2003
Boundary Extraction: ExampleBoundary Extraction: Example
DIP: Monsoon 2003
Region FillingRegion Filling
• Fills a regions, whose boundary is given as
8-connected neighbours:
Xk = (Xk-1 ⊕ B) ∩ Ac, k = 1, 2, 3,…
…