IT5409 Ch5 Segmentation v3
IT5409 Ch5 Segmentation v3
Computer Vision
Course
School of Information and
Communication Technology
Computer Vision
Chapter 5: Image segmentation
1
2/20/24
Chapter 5. Segmentation
Introduction
• Purpose:
• to partition an image into meaningful regions with respect
to a particular application
• Goal:
• to cluster pixels into salient image regions, i.e., regions
corresponding to individual surfaces, objects, or natural
parts of objects.
• The segmentation is based on the feature measurements
taken from the image:
• grey level, color, texture, depth or motion…
2
2/20/24
Introduction
Introduction
3
2/20/24
Applications
• Image segmentation
• is usually an initial and vital step in a series of processes
aimed at overall image understanding of computer vision
• Segmentation applications:
• Object recognition;
• Image retrieval;
• Medical image analysis;
• Boundary estimation within motion or stereo systems;
• Tracking of objects in a video;
• Classification of terrains visible in satellite images
• …
Applications
4
2/20/24
10
11
5
2/20/24
Examples
12
Pixel-based approach
• Pixel-based approach
• Thresholding
• Clustering
13
6
2/20/24
Thresholding
• Thresholding can be
• Global: one threshold for the whole image
• Local: one threshold for a part of the image
• Adaptive: one threshold ajusted according to each image
or each image part
15
16
7
2/20/24
0, 𝑓(𝑥, 𝑦) < 𝑇
𝑔 𝑥, 𝑦 = &
1, 𝑓(𝑥, 𝑦) ≥ 𝑇
17
18
8
2/20/24
Multi-thresholds
19
Multi-thresholds
0, 𝑓 𝑥, 𝑦 < 𝑇1
𝑔 𝑥, 𝑦 = /1, 𝑇2 > 𝑓 𝑥, 𝑦 ≥ 𝑇1
2, 𝑓 𝑥, 𝑦 ≥ 𝑇2
20
9
2/20/24
Threshold value
21
Source : www.iro.umontreal.ca/~dift2730/
22
10
2/20/24
23
24
11
2/20/24
25
• Problem:
• Global thresholding cannot be used in that case
• Solution: adaptive local thresholding
26
12
2/20/24
• Split the image in sub-images and process each sub-image with its own threshold
• The main decision is to choose the size of the sub-images
• Before processing each sub-image, check the variance to make sure that the sub-
image contains two regions, and not only one.
• Example: no thresholding for a sub-image if variance<100
27
Bimodal
Bimodal ?
28
13
2/20/24
29
Clustering-based segmentation
• Image is considered as a set of N image pixels.
• Attributes (property) of the pixels
• gray level of single-band gray tone images,
• color values of three-band color images: (r, g, b)
• values of multi-band images, …
• Based on the similar attribute, pixels classification operators
partition an image into homogeneous regions.
• Clustering provides a grouping of the pixels that is dependent on their values
in the image but not necessarily on their locations in the image unless
location is a specified property
• Classifier provide the pixel classes which should be homogeneous regions.
30
14
2/20/24
Clustering algorithms
• Clustering algorithms:
• K-Means clustering
• Mean-Shift Clustering
• Expectation-Maximization Clustering
• Watershed Segmentation
• Graph Cuts (Spectral clustering)
• Normalized cuts
• …
31
K-means Clustering
32
15
2/20/24
K-means Clustering
33
K-means Clustering
Source : D.A. Forsyth and J. Ponce. Computer Vision : A Modern Approach. Prentice-Hall, 2002.
34
16
2/20/24
K-means Clustering
Source : D.A. Forsyth and J. Ponce. Computer Vision : A Modern Approach. Prentice-Hall, 2002.
35
Example
36
17
2/20/24
Example
37
• Pros
• Simple, fast
38
18
2/20/24
• Intensity, Color?
• Position
• Texture
•…
39
Segmentation as clustering
40
19
2/20/24
Segmentation as clustering
41
Segmentation as clustering
F2
Filter bank
of 24 filters
…
F24
Feature space: filter bank responses (e.g., 24-d)
Slide credit: Kristen Grauman
2/20/24 CV Group – School of Information and Communication and Technology 42
42
20
2/20/24
Count
Image Texton map
Texton index
Count
Count
Malik, Belongie, Leung and Shi. IJCV 2001. Texton index Texton index
43
44
21
2/20/24
Region-based segmentation
45
Region-based segmentation
46
22
2/20/24
Region growing
47
• Algorithm:
• Choose K random pixels in K regions
• Use 8-connected and threshold to determine
• Repeat a and b until almost points are K classified.
• Example illustrated:
48
23
2/20/24
49
Example
Simulation
of region
growing
(90% pixels )
50
24
2/20/24
Split-and-merge
• Split (step 1)
• Recursively split all non-homogeneous
regions following a given criteria
• variance, max-min, …
• Dividing one region gives 4 subregions
• Subregion attributes are re-computed
• Merge (step 2)
• Group all homogeneous adjacent
regions following a given criteria
51
Split-and-merge: split
Image initiale
Split1
Split 2
split 3
52
25
2/20/24
Split-and-merge: merge
Quadtree
53
Split-and-merge
54
26
2/20/24
Edge-based segmentation
• Algorithms:
• Basic Edge Detection
• The Marr-Hildreth edge detector (LoG)
• Short response Hilbert transform (SRHLT)
• Watersheds
55
Watershed segmentation
2D image Visualization in 3D
Source : http://www.gpa.etsmtl.ca/cours/gpa669/
2/20/24 CV Group – School of Information and Communication and Technology 56
56
27
2/20/24
Watershed segmentation
57
Watershed segmentation
58
28
2/20/24
Watershed segmentation
59
Watershed segmentation
https://docs.opencv.org/master/d3/db4/tutorial_py_watershed.html
2/20/24 CV Group – School of Information and Communication and Technology 60
60
29
2/20/24
Watershed segmentation
61
Segmentation – advices
• Image segmentation
• No method works for all images
• No miracle, no warranty!
62
30
2/20/24
Segmentation – advices
• Image Pre-processing:
• good selection of sensors and energy source, and
controled image acquisition conditions help to make
segmentation easier and more efficient
• For some applications, we realize today that we can
avoid to segment the image. It is often better like
this.
63
Limits of segmentation
64
31
2/20/24
• Term 'segmentation' :
• less used
• segmentation, which let think about an exact image splitting into regions
• 'Pixel grouping'
• which refers only to a notion of similarity between pixels without relation on the
content of regions.
65
Motion segmentation
66
32
2/20/24
THANK YOU !
33