![Page 1: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/1.jpg)
Binary Image Analysis: Part 2Readings: Chapter 3: 3.5-3.7
• mathematical morphology• region properties• region adjacency
1
![Page 2: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/2.jpg)
2
Mathematical Morphology
Binary mathematical morphology consists of twobasic operations
dilation and erosion
and several composite relations
closing and opening conditional dilation . . .
![Page 3: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/3.jpg)
3
Dilation
Dilation expands the connected sets of 1s of a binary image.
It can be used for
1. growing features
2. filling holes and gaps
![Page 4: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/4.jpg)
4
Erosion
Erosion shrinks the connected sets of 1s of a binary image.
It can be used for
1. shrinking features
2. Removing bridges, branches and small protrusions
![Page 5: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/5.jpg)
5
Structuring ElementsA structuring element is a shape mask used inthe basic morphological operations.
They can be any shape and size that isdigitally representable, and each has an origin.
The origin is usually the center if the structuringelement is symmetric.
boxhexagon disk something
box(length,width) disk(diameter)
![Page 6: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/6.jpg)
6
Dilation with Structuring Elements
The arguments to dilation and erosion are1. a binary image B2. a structuring element S
dilate(B,S) takes binary image B, places the originof structuring element S over each 1-pixel, and ORsthe structuring element S into the output image atthe corresponding position.
0 0 0 00 1 1 00 0 0 0
11 1
0 1 1 00 1 1 10 0 0 0
originBS
dilate
B S
![Page 7: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/7.jpg)
7
Erosion with Structuring Elements
erode(B,S) takes a binary image B, places the origin of structuring element S over every pixel position, andORs a binary 1 into that position of the output image only ifevery position of S (with a 1) covers a 1 in B.
0 0 1 1 00 0 1 1 00 0 1 1 01 1 1 1 1
111
0 0 0 0 00 0 1 1 00 0 1 1 00 0 0 0 0
B S
origin
erode
B S
![Page 8: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/8.jpg)
8
Example to Try
0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 1 0 01 1 1 1 1 1 1 10 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
1 1 11 1 11 1 1
erode
dilate with same structuring element
SB
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 00 0 0 1 1 0 0 00 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 00 0 1 1 1 1 0 00 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
This kind of erosion plus dilation iscalled an opening.
![Page 9: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/9.jpg)
9
Opening and Closing
• Closing is the compound operation of dilation followed by erosion (with the same structuring element)
• Opening is the compound operation of erosion followed by dilation (with the same structuring element)
![Page 10: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/10.jpg)
10
Use of Opening
Original Opening Corners
What kind of structuring element was used in the opening?
How did we get the corners?
![Page 11: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/11.jpg)
11
Gear Tooth Inspection
originalbinary image
detecteddefects
How didthey do it?
![Page 12: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/12.jpg)
12
Some Details (see Ch 3)1. Original image 2. Find centers of holes by erosion with a circular ring element
3. Dilate by a 4. OR the hexagons hexagon mask into the original
5. Use disc the size of the body, open 6. AND result of 5 to remove teeth. with 1 to get Dilate. Subtract. just the teeth.
7. Dilate 6 with a 7. Show defects small element in red for customer that leaves the defects as holes
![Page 13: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/13.jpg)
13
Region PropertiesProperties of the regions can be used to recognize objects.
• geometric properties (Ch 3)
• gray-tone properties
• color properties
• texture properties
• shape properties (a few in Ch 3)
• motion properties
• relationship properties (1 in Ch 3)
![Page 14: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/14.jpg)
14
Geometric and Shape Properties
• area• centroid• perimeter • perimeter length• circularity• elongation• mean and standard deviation of radial distance• bounding box• extremal axis length from bounding box• second order moments (row, column, mixed)• lengths and orientations of axes of best-fit ellipse
![Page 15: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/15.jpg)
15
Region Adjacency Graph
A region adjacency graph (RAG) is a graph in whicheach node represents a region of the image and an edgeconnects two nodes if the regions are adjacent.
1
2
34
1 2
34
![Page 16: Binary Image Analysis: Part 2 Readings: Chapter 3: 3.5-3.7](https://reader036.vdocuments.site/reader036/viewer/2022081604/568167ee550346895ddd5d89/html5/thumbnails/16.jpg)
What’s all this for?
16
Once regions are identified and their propertiesand relationships computed, we can start usingthem for higher-level tasks such as:
• inspection• object recognition• image matching• classification in general