0% found this document useful (0 votes)
9 views

09_Lecture -Chapter 10- Image Segmentation Part II_Region Based

Chapter 10 of the Digital Image Processing course focuses on region-based segmentation techniques, including region growing and region splitting & merging. It discusses the properties of intensity values used for segmentation, emphasizing the importance of similarity and discontinuity. The chapter also includes examples and algorithms for implementing these segmentation methods.

Uploaded by

Yousuf ali Safin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

09_Lecture -Chapter 10- Image Segmentation Part II_Region Based

Chapter 10 of the Digital Image Processing course focuses on region-based segmentation techniques, including region growing and region splitting & merging. It discusses the properties of intensity values used for segmentation, emphasizing the importance of similarity and discontinuity. The chapter also includes examples and algorithms for implementing these segmentation methods.

Uploaded by

Yousuf ali Safin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

CSE4227 Digital Image Processing

Chapter 10 – Image Segmentation Part II


(Region based)

Dr. Kazi A Kalpoma


Professor, Department of CSE
Ahsanullah University of Science & Technology (AUST)

Contact: [email protected]
Google Class code: fmxdafw

CSE | AUST Spring 2024


Today’s Contents
❑Region Based Segmentation
❑What is a Region
❑Region Growing, and
❑Region Splitting & Merging
❑Thresholding Based Segmentation
❑GLOBAL
❑ADAPTIVE
❑LOCAL

• 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

• In edge detection we segment an image by


identifying the boundaries of the objects.
• These boundaries are the locations where the
intensity is changed.
• In the region based segmentation approach,
we will identify regions occupied by the
objects.
• We will group pixels which are similar in some
region property.
Edge Pixels
20 0 0 0 0 0 0 0

20 0 0 0 0 0 0 0

20 0 143 143 143 143 0 0

20 0 143 200 200 143 0 0

20 0 143 200 200 143 0 0

20 0 143 143 143 143 0 0

20 0 0 0 0 0 0 0

20 0 0 0 0 0 0 0

8x8 cropped Image


Edge based vs Region based Segmentation
20 0 0 0 0 0 10 10

20 0 0 0 0 0 10 10

20 0 143 143 143 143 10 10

20 0 143 200 200 143 10 10

20 0 143 200 200 143 10 10

20 0 143 143 143 143 10 10

20 0 0 0 0 0 10 10

20 0 0 0 0 0 10 10

8x8 cropped Image


Edge based vs Region based Segmentation
20 0 0 0 0 0 10 10

20 0 0 0 0 0 10 10

20 0 143 143 143 143 10 10

20 0 143 200 200 143 10 10

20 0 143 200 200 143 10 10

20 0 143 143 143 143 10 10

20 0 0 0 0 0 10 10

20 0 0 0 0 0 10 10
Region Based Segmentation Method

❑Segments the image into various regions having


similar characteristics.

❑The two basic techniques based on this method


are:
i) Region Growing, and
ii) Region Splitting & Merging.
Region Growing
Region growing techniques start with one pixel of a
potential region and try to grow it by adding adjacent
pixels till the pixels being compared are too disimilar.

• The first pixel selection can be just the first unlabeled


pixel in the image or a set of seed pixels can be chosen
from the image.

• Usually a statistical test is used to decide which pixels


can be added to a region.

12
Region-Based Segmentation

Example: Region Growing based on 8-connectivity


Region Growing Algorithm

* 14
Example

4-connectivity
Example

4-connectivity
Example

8-connectivity
Example
Region Splitting and Merging

❑ Let R represent the entire spatial region occupied by an


image. Image segmentation is a process that partitions R
into n sub-regions, R1, R2, …, Rn, such that

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

Problem? Adjacent regions could be same

Solution? Allow Merge

* 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

1. Split into four disjointed quadrants any region Ri where P(Ri)=False

2. Merge any adjacent regions Rj and Rk for which P(Rj U Rk)=True

3. Stop when no further merging or splitting is possible

* 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

Please see the video recording to understand the example.


* Link is provided onSegmentation
Image the google classroom. 24
Region Splitting Example
Split into quadrant if T < (max-min), continue until no more spit is possible

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

Please see the video recording to understand the example.


* Link is provided onSegmentation
Image the google classroom. 25
Region Splitting Example
Split into quadrant if T < (max-min), continue until no more spit is possible

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

Please see the video recording to understand the example.


* Link is provided onSegmentation
Image the google classroom. 26
Region Splitting Example
Now terminate splitting and go for Merge the adjacent regions If T is greater

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

Please see the video recording to understand the example.


* Link is provided onSegmentation
Image the google classroom. 27
Region Merging Example
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 28
Link is provided on the google classroom.
Region
RegionMerging
MergingExample….
Example
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 29
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 30
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 31
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 32
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 33
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 34
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 35
Link is provided on the google classroom.
Region Merging Example….
Merge the adjacent regions If T is greater than (maxi-minj)
AND (maxj-mini) of both regions

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

Please see the video recording to understand the example.


* Image Segmentation 36
Link is provided on the google classroom.
https://www.youtube.com/watch?v=hKYBNdSspIo

* Image Segmentation 37
Thresholding
■ Segmentation into two classes/groups
❑ Foreground (Objects)
❑ Background

* Image Segmentation 38
Thresholding

* Image Segmentation 39
Thresholding

Objects & Background

1.0 r > threshold


s=
0.0 r <= threshold

* 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?

Multilevel Thresholding can be a solution?

* 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

You might also like