0% found this document useful (0 votes)
6 views30 pages

Segmentation

The document provides an introduction to image segmentation, detailing its purpose in partitioning images into meaningful segments for analysis and visualization. It discusses various techniques for segmentation, including intensity thresholding, Otsu binarization, and region growing, emphasizing their applications and improvements. The content is aimed at enhancing understanding of segmentation methods within the field of computer vision.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views30 pages

Segmentation

The document provides an introduction to image segmentation, detailing its purpose in partitioning images into meaningful segments for analysis and visualization. It discusses various techniques for segmentation, including intensity thresholding, Otsu binarization, and region growing, emphasizing their applications and improvements. The content is aimed at enhancing understanding of segmentation methods within the field of computer vision.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Introduction to Computer Vision

(ME-4201)

Segmentation
Phung Thanh Huy
Department of Mechatronics
Ho Chi Minh City University of Technology
Vietnam National University Ho Chi Minh City
Ver2024.1

Ho Chi Minh City– 2024


Segmentation
Segments
• Image segmentation partitions an image into regions, called segments.
• Purposes: for further image analysis, improved efficiency of image
compression, or just for visualization effects.
• Image segmentation creates segments of connected pixels by analyzing
some similarity criteria.
• Segmentation aims at identifying “meaningful” segments that can be
used for describing the contents of an image, such as a segment for
“background”, segments for “objects”, or particular object categories.

Segmentation |2
Segmentation
Segments and segmentation

Image is partitioned into


segments and six segments
of this partition.

The image mapped into a


(nearly binary) image defined
by Winnemöller stylization.
Connected dark or bright
regions define segments

Segmentation of the
image by mean-shift for radii r
= 12 (middle) and r = 24
(right),

Segmentation |3
Segmentation
Segments and segmentation

Segmentation |4
Segmentation
Segments and segmentation

Segmentation |5
Segmentation
Segments and segmentation

Segmentation |6
Segmentation by binarization
Intensity Thresholding
Global thresholding Multiple thresholding

• When the value of T changes over an image, we use the term variable
thresholding
• If T depends on the spatial coordinates (x, y) themselves, then variable
thresholding is often referred to as dynamic or adaptive thresholding
Segmentation |7
Segmentation by binarization
Intensity Thresholding
• The thresholding results are affected by noise and illumination.

Segmentation |8
Segmentation by binarization
Intensity Thresholding
• The thresholding results are affected by noise and illumination.

Segmentation |9
Segmentation by binarization
Intensity Thresholding
• Global Thresholding Algorithm

Segmentation |10
Segmentation by binarization
Otsu Binarization
Principle: maximizing the between-class variance
• Consider normalized histogram 𝑝𝑖 of an n-bit image. The intensity level: 0 → (2𝑛 − 1).
Let 𝐿 = 2𝑛

• Support 𝑇 𝑘 = 𝑘 is threshold

• The mean intensities

Segmentation |11
Segmentation by binarization
Otsu Binarization
• The cumulative mean (average intensity) up to level k

and the average intensity of the entire image (i.e., the global mean)

• The effectiveness of the process is justified by:

• Final result
Find

Segmentation |12
Segmentation by binarization
Otsu Binarization

𝑖 0 1 2 … 2𝑛 − 2 2𝑛 − 1
𝑝𝑖
𝑖𝑝𝑖
𝑃1 (𝑘)
𝑚 𝑘 𝑚𝐺
𝜎𝐵2 𝑘 𝜎𝐺2

• Obtain the Otsu threshold, 𝑘 ∗ , as the value of 𝑘 for which 𝜎𝐵2 𝑘 is maximum.
• If the maximum is not unique, obtain k* by averaging the values of k corresponding
to the various maxima detected.

Segmentation |13
Segmentation by binarization
Otsu Binarization

Segmentation |14
Segmentation by binarization
Improving the binarization
Using image smoothing

Segmentation |15
Segmentation by binarization
Improving the binarization
Using Edges

Segmentation |16
Segmentation by binarization
Improving the binarization
Using Edges

1. Compute an edge image as either the magnitude of the gradient, or


absolute value of the Laplacian of f(x,y)
2. Specify a threshold value T
3. Threshold the image and produce a binary image, which is used as
a mask image; and select pixels from f(x,y) corresponding to
“strong” edge pixels
4. Compute a histogram using only the chosen pixels in f(x,y)
5. Use the histogram from step 4 to segment f(x,y) globally

Segmentation |17
Segmentation by binarization
Multiple Thresholding
• In the case of classes, , , ..., , the between-class variance is:

• The optimum threshold values, 𝑘1∗ , 𝑘2∗ , … , 𝑘𝐾−1



, that maximize

• Thresholding

• Efficiency

Segmentation |18
Segmentation by binarization
Multiple Thresholding Region 3 (b)

Region 1 (a)
Region 2 (b)

Segmentation |19
Segmentation by binarization
Variable Thresholding Based on Local Image Properties
At each point (x,y), consider a neighborhood 𝑆𝑥𝑦 . Inside the neighborhood area:
Need to choose:
If the background is nearly constant + Neighborhood size.
+a
+b
Global mean

Improvement:

Segmentation |20
Segmentation by binarization
Variable Thresholding Based on Moving Averages
• Computing a moving average along scan lines of an image.
• The scanning typically is carried out line by line in a zigzag pattern to reduce
illumination bias
𝑧1
𝑚 1 =
𝑛 n: number of points for
𝑘
1 1 averaging
𝑚 𝑘 = ෍ 𝑧𝑖 = 𝑚 𝑘 − 1 + 𝑧𝑘 − 𝑧𝑘−𝑛+1
𝑛 𝑛
𝑖=𝑘−𝑛+1

Image is padded with (n-1) zeros pixels

n=3

Segmentation |21
Segmentation by binarization
Variable Thresholding Based on Moving Averages
• For each point

Segmentation |22
Segmentation by binarization
Variable Thresholding Based on Moving Averages

• Thresholding based on moving averages works well when the objects are small with
respect to the image size.
• Quite useful in document processing

Segmentation |23
Regional-based Segmentation
Basic Topology and Relationships of Images
Neighbors

Segmentation |24
Regional-based Segmentation
Basic Topology and Relationships of Images
Adjacency

Segmentation |25
Regional-based Segmentation
Basic Topology and Relationships of Images
Adjacency

Segmentation |26
Regional-based Segmentation
Basic Topology and Relationships of Images
Path (Curve)

Segmentation |27
Regional-based Segmentation
Basic Topology and Relationships of Images
Connectivity
Let S represent a subset of pixels in an image.
• Two pixels p and q are said to be connected in S if there exists a path between
them consisting entirely of pixels in S.
• For any pixel p in S, the set of pixels that are connected to it in S is called a
connected component of S.
• If it only has one connected component, then set S is called a connect set.
Region
Let R be a subset of pixels in an image.
• R is a region of the image if R is a connected set.
• The boundary (also called border or contour) of a region R is the set of pixels in
the region that have one or more neighbors that are not in R.

Segmentation |28
Regional-based Segmentation
Basic Topology and Relationships of Images
Distance

Segmentation |29
Regional-based Segmentation
Region Growing
• Region growing is a procedure that groups pixels or subregions into
larger regions.
• The simplest of these approaches is pixel aggregation, which starts
with a set of “seed” points and from these grows regions by
appending to each seed points those neighboring pixels that have
similar properties (such as gray level, texture, color, shape).
• Region growing based techniques are better than the edge-based
techniques in noisy images where edges are difficult to detect.

Example: Region Growing based on 8-connectivity

Segmentation |30

You might also like