09_Lecture -Chapter 10- Image Segmentation Part II_Region Based
09_Lecture -Chapter 10- Image Segmentation Part II_Region Based
Contact: [email protected]
Google Class code: fmxdafw
• Chapter 10 from R.C. Gonzalez and R.E. Woods, Digital Image Processing
(3rd Edition), Prentice Hall, 2008 [ Section 10.1, 10.2 (excluding 10.2.7) ]
Segmentation Algorithms
Segmentation can be performed based on one of the
following two basic properties of intensity values:
❑Similarity
⮚Partitioning an image into regions that are
similar according to a set of predefined
criteria.
❑Discontinuity
⮚Detecting boundaries of regions based on
local discontinuity in intensity.
Region based segmentation
20 0 0 0 0 0 0 0
20 0 0 0 0 0 0 0
20 0 0 0 0 0 0 0
20 0 0 0 0 0 10 10
20 0 0 0 0 0 10 10
20 0 0 0 0 0 10 10
20 0 0 0 0 0 10 10
20 0 0 0 0 0 10 10
20 0 0 0 0 0 10 10
Region Based Segmentation Method
12
Region-Based Segmentation
* 14
Example
4-connectivity
Example
4-connectivity
Example
8-connectivity
Example
Region Splitting and Merging
Logical predicate
Region Splitting and Merging
■ Region Splitting
❑ Region Growing: Starts from a set of seed points.
❑ Region Splitting: Starts with the whole image as a single
region and subdivide the regions that do not satisfy a
condition.
❑ Image = One Region R
❑ Select a predicate P (gray values etc.)
❑ Successively divide each region into smaller and smaller
quadrant regions so that:
* Image Segmentation 20
Region Splitting and Merging
■ Region Splitting
* Image Segmentation 21
Region-Based Segmentation
■ Region Merging
❑ Region merging is the opposite of region splitting.
❑ Merge adjacent regions Ri and Rj for which:
■ Region Splitting/Merging
❑ Stop when no further split or merge is possible
* Image Segmentation 22
Region-Based Segmentation
■ Example
* Image Segmentation
23
Region Splitting and Merging Example
Split into four disjoint quadrant and select a threshold first…say T <= 4.
5 6 6 6 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
5 6 6 6 7 7 6 6
6 7 6 7 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5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
5 6 6 6 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
5 6 6 6 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
5 6 6 6 7 7 6 6
6 7 6 7 5 5 4 7
6 6 4 4 3 2 5 6
5 4 5 4 2 3 4 6
0 3 2 3 3 2 4 7
0 0 0 0 2 2 5 6
1 1 0 1 0 3 4 4
1 0 1 0 2 3 5 4
* Image Segmentation 37
Thresholding
■ Segmentation into two classes/groups
❑ Foreground (Objects)
❑ Background
* Image Segmentation 38
Thresholding
* Image Segmentation 39
Thresholding
* Image Segmentation 40
Thresholding
❖ GLOBAL
❖ LOCAL / REGIONAL
❖ ADAPTIVE
* Image Segmentation 41
Thresholding
* Image Segmentation 42
Thresholding
* Image Segmentation 43
Global Thresholding
■ Single threshold value for entire image
■ Fixed ?
■ Automatic
❑ Intensity histogram
* Image Segmentation 44
Global Thresholding
■ Single threshold value for entire image
■ Fixed ?
■ Automatic
❑ Intensity histogram
* Image Segmentation 45
Global Thresholding
* Image Segmentation 46
https://www.youtube.com/watch?v=f1SaYzOthCM
* Image Segmentation 47
Global Thresholding?
* Image Segmentation 48
Multilevel Thresholding
* Image Segmentation 49
Multilevel Thresholding
* Image Segmentation 50
Multilevel Global Thresholding?
* Image Segmentation 51
Basic Adaptive Thresholding
* Image Segmentation 52
Local Adaptive Thresholding
❑The Local Adaptive Thresholding chooses
different threshold values for every pixel in
the image based on an analysis of its neighboring
pixels.
■ Threshold: function of neighboring pixels
Image Segmentation 53
Local Adaptive Thresholding
■ Niblack Algorithm
■ Neighborhood size???
* Image Segmentation 54
Thresholding
* Image Segmentation 55
https://youtu.be/nPyb2BVBeB8
* Image Segmentation 56
K-Means Clustering
1. Chose the number (K) of clusters and randomly select the
centroids of each cluster.
2. For each data point:
❑ Calculate the distance from the data point to each cluster.
❑ Assign the data point to the closest cluster.
3. Recompute the centroid of each cluster.
4. Repeat steps 2 and 3 until there is no further change in
the assignment of data points (or in the centroids).
* Image Segmentation 57