1 regions and binary images hao jiang computer science department sept. 25, 2014
TRANSCRIPT
![Page 1: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/1.jpg)
1
Regions and Binary Images
Hao Jiang
Computer Science Department
Sept. 25, 2014
![Page 2: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/2.jpg)
Figure Ground Separation
2
![Page 3: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/3.jpg)
Brightness Thresholding
3
![Page 4: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/4.jpg)
=-
Thresholding Given a grayscale image or an intermediate matrix
threshold to create a binary output.
Example: background subtraction
Looking for pixels that differ significantly from the “empty” background.
fg_pix = find(diff > t);Slides from Kristen Grauman
![Page 5: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/5.jpg)
Thresholding Given a grayscale image or an intermediate matrix
threshold to create a binary output.
Example: color-based detection
Looking for pixels within a certain hue range.
fg_pix = find(hue > t1 & hue < t2);
Slides from Kristen Grauman
![Page 6: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/6.jpg)
More Binary Images
6
Slide from Kristen Grauman
![Page 7: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/7.jpg)
Issues
How to demarcate multiple regions of interest? Count objects Compute further features per
object
What to do with “noisy” binary outputs? Holes Extra small fragments
Slide from Kristen Grauman
![Page 8: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/8.jpg)
Find Connected Regions
8
![Page 9: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/9.jpg)
Find Connected Regions
9
Our target in this image is the largest blob.
![Page 10: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/10.jpg)
Connected Components
Identify distinct regions of “connected pixels”
Shapiro and Stockman
![Page 11: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/11.jpg)
Pixel Neighbors
11
4 neighboring pixels of the blue pixel
![Page 12: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/12.jpg)
Pixel Neighbors
12
8 neighboring pixels of the blue pixel
![Page 13: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/13.jpg)
Recursive Method
13
label = 2for i = 1 to rows for j = 1 to cols if I(i, j) == 1 labelConnectedRegion(i, j, label) label ++; endend
![Page 14: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/14.jpg)
Recursive Method
14
function labelConnectedRegion(int i, int j, int label) if (i,j) is labeled or background or out of boundary return
I(i,j)=label for (m,n) belongs to neighbors of (i,j) labelConnectedRegion(m,n,label) end
![Page 15: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/15.jpg)
Sequential connected components
Slide from J. Neira
![Page 16: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/16.jpg)
Sequential connected components
![Page 17: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/17.jpg)
Example
17
1 1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 18: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/18.jpg)
Example
18
2 1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 19: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/19.jpg)
Example
19
2 2 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 20: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/20.jpg)
Example
20
2 2 3 1 1
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 21: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/21.jpg)
Example
21
2 2 3 3 1
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 22: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/22.jpg)
Example
22
2 2 3 3 3
1 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 23: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/23.jpg)
Example
23
2 2 3 3 3
2 1 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 24: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/24.jpg)
Example
24
2 2 3 3 3
2 2 1 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 25: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/25.jpg)
Example
25
2 2 3 3 3
2 2 2 1
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 26: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/26.jpg)
Example
26
2 2 3 3 3
2 2 2 2
1 1 1 1
1 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
(2,3)
![Page 27: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/27.jpg)
Example
27
2 2 3 3 3
2 2 2 2
2 1 1 1
1 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 28: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/28.jpg)
Example
28
2 2 3 3 3
2 2 2 2
2 2 1 1
1 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 29: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/29.jpg)
Example
29
2 2 3 3 3
2 2 2 2
2 2 4 1
1 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 30: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/30.jpg)
Example
30
2 2 3 3 3
2 2 2 2
2 2 4 4
1 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 31: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/31.jpg)
Example
31
2 2 3 3 3
2 2 2 2
2 2 4 4
5 1 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 5
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 32: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/32.jpg)
Example
32
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 1 1 1
1 1 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
(5,2)
![Page 33: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/33.jpg)
Example
33
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 1 1
1 1 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 34: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/34.jpg)
Example
34
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 1
1 1 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 35: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/35.jpg)
Example
35
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
1 1 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 36: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/36.jpg)
Example
36
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
5 1 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 37: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/37.jpg)
Example
37
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
5 5 1 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 38: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/38.jpg)
Example
38
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
5 5 5 1 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 39: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/39.jpg)
Example
39
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
5 5 5 5 1
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
(5,2)
![Page 40: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/40.jpg)
Example
40
2 2 3 3 3
2 2 2 2
2 2 4 4
5 5 2 4 4
5 5 5 5 4
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 41: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/41.jpg)
Example
41
3 3 3 3 3
3 3 3 3
3 3 4 4
3 3 3 4 4
3 3 3 3 4
2 3
3 3
4 4
5 3
6 6
7 7
8 8
9 9
Image Label equivalence table
![Page 42: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/42.jpg)
Region properties
Given connected components, can compute simple features per blob, such as: Area (num pixels in the region) Centroid (average x and y position of pixels in the region) Bounding box (min and max coordinates)
How could such features be useful?
A1=200
A2=170
![Page 43: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/43.jpg)
Issues
How to demarcate multiple regions of interest? Count objects Compute further features per
object
What to do with “noisy” binary outputs? Holes Extra small fragments
![Page 44: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/44.jpg)
Morphological operators
Change the shape of the foreground regions/ objects.
Useful to clean up result from thresholding
Basic operators are: Dilation Erosion
![Page 45: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/45.jpg)
Dilation
Expands connected components Grow features Fill holes
Before dilation After dilation
![Page 46: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/46.jpg)
Erosion
Erode connected components Shrink features Remove bridges, branches, noise
Before erosion After erosion
![Page 47: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/47.jpg)
Structuring elements
Masks of varying shapes and sizes used to perform morphology, for example:
Scan mask across foreground pixels to transform the binary image
>> help strel
![Page 48: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/48.jpg)
Dilation
At each position: Dilation: OR (MAX) of everything inside the
structuring element mask.
![Page 49: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/49.jpg)
Example for Dilation (1D)
SExfxg )()(
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1Output Image
111
Adapted from T. Moeslund
![Page 50: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/50.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1Output Image
111
![Page 51: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/51.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0Output Image
111
![Page 52: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/52.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1Output Image
111
![Page 53: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/53.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1Output Image
111
![Page 54: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/54.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1 1Output Image
111
![Page 55: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/55.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1 1 1Output Image
111
![Page 56: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/56.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1 1 1 1Output Image
111
![Page 57: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/57.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1 1 1 1 1Output Image
111
Note that the object gets bigger and holes are filled.>> help imdilate
![Page 58: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/58.jpg)
Example for Dilation
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
1 1 0 1 1 1 1 1 1 1Output Image
111
Note that the object gets bigger and holes are filled.>> help imdilate
![Page 59: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/59.jpg)
Erosion
At each position: Erosion: AND (MIN) of everything inside the
structuring element mask.
![Page 60: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/60.jpg)
Example for Erosion (1D)
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0Output Image
111
SExfxg O)()( _
![Page 61: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/61.jpg)
Example for Erosion (1D)
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0Output Image
111
SExfxg O)()( _
![Page 62: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/62.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0Output Image
111
![Page 63: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/63.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0Output Image
111
![Page 64: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/64.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0Output Image
111
![Page 65: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/65.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0 1Output Image
111
![Page 66: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/66.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0 1 0Output Image
111
![Page 67: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/67.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0 1 0 0Output Image
111
![Page 68: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/68.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0 1 0 0 0Output Image
111
![Page 69: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/69.jpg)
Example for Erosion
1 0 0 0 1 1 1 0 1 1Input image
Structuring Element
0 0 0 0 0 1 0 0 0 0Output Image
111
Note that the object gets smaller>> help imerode
![Page 70: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/70.jpg)
Opening
Erode, then dilate Remove small objects, keep original shape
Before opening After opening
Slide from Kristen Grauman
![Page 71: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/71.jpg)
Closing
Dilate, then erode Fill holes, but keep original shape
Before closing After closing
Slide from Kristen Grauman
![Page 72: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/72.jpg)
Morphology Operators on Grayscale Images
Dilation and erosion typically performed on binary images. If image is grayscale: for dilation take the neighborhood max, for erosion
take the min.
original dilated eroded
Slide from Kristen Grauman
![Page 73: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/73.jpg)
Matlab
Create structure element
se = strel(‘disk’, radius); Erosion
imerode(image, se); Dilation
imdilate(image, se); Opening
imopen(image, se); Closing
imclose(image, se); More possibilities
bwmorph(image, ‘skel’);
73
![Page 74: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/74.jpg)
Figure Ground Separation
74
![Page 75: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/75.jpg)
Brightness Thresholding
75
![Page 76: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/76.jpg)
Opening
76
![Page 77: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/77.jpg)
Find the Largest Connected Region
77
![Page 78: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/78.jpg)
Example Using Binary Image Analysis: segmentation of a liver
Slide credit: Li Shen Slide from Kristen Grauman
![Page 79: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/79.jpg)
Example Using Binary Image Analysis:Bg subtraction + blob detection
…
Slide from Kristen Grauman
![Page 80: 1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014](https://reader036.vdocuments.net/reader036/viewer/2022062422/56649f205503460f94c38363/html5/thumbnails/80.jpg)
University of Southern Californiahttp://iris.usc.edu/~icohen/projects/vace/detection.htm
Example Using Binary Image Analysis:Bg subtraction + blob detection
Slide from Kristen Grauman