0% found this document useful (0 votes)
4 views29 pages

Week 10 - Image Segmentation (Part 2) (1)

The document discusses three image segmentation techniques: Otsu's Method, Region Growing, and Split and Merge. Otsu's Method binarizes grayscale images by minimizing intra-class variance to find an optimal threshold, while Region Growing expands regions from seed points based on similarity criteria. The Split and Merge algorithm recursively divides an image into quadrants and merges adjacent regions that meet homogeneity criteria, providing a structured approach to image segmentation.

Uploaded by

Nessa Wijaya
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)
4 views29 pages

Week 10 - Image Segmentation (Part 2) (1)

The document discusses three image segmentation techniques: Otsu's Method, Region Growing, and Split and Merge. Otsu's Method binarizes grayscale images by minimizing intra-class variance to find an optimal threshold, while Region Growing expands regions from seed points based on similarity criteria. The Split and Merge algorithm recursively divides an image into quadrants and merges adjacent regions that meet homogeneity criteria, providing a structured approach to image segmentation.

Uploaded by

Nessa Wijaya
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/ 29

1.

Otsu's Method
Otsu’s thresholding technique is a classification-based method which searches for the
threshold that minimizes the intra-class variance, defined as a weighted sum of
variances of the two classes.

It is the most popular method of binarizing a grayscale image. Otsu’s algorithms simply
assume that a grayscale image consists of two types of pixels. Foreground and
background pixels.

It divides all the pixels into two clusters. It minimises the intra-cluster variation (within
class variance) by maximising the inter-cluster variance (between class variance).
Finally, it returns a single intensity value which is called a threshold value. This
threshold value divides the two clusters of pixels.

All pixels of one cluster are assigned intensity value 0 and pixels of the second cluster
are assigned value 1. Thus, it binarises the grayscale image.
1. Otsu's Method

Intra-class variance refers to the variation or dispersion of


data points within a single class or group. It essentially
measures how similar or dissimilar the members of a
specific class are to each other.

In simpler terms: Imagine you have a group of photos of


cats. Intra-class variance would describe how much the
individual cats in those photos differ from each other within
the same class (the "cat" class).
1. Otsu's Method
The Algorithm Step by Step
1.Compute the histogram of the grayscale image.
2.Calculate probabilities of each intensity level by dividing the histogram
values by the total number of pixels.
3.For each possible threshold T (typically 0 to 255 for an 8-bit image):
o Divide the pixels into two classes: C₁ (pixels with levels [0,...,T]) and C₂
(pixels with levels [T+1,...,L-1])
o Compute the class probabilities ω₁(T) and ω₂(T)
o Calculate the class means μ₁(T) and μ₂(T)
o Compute the between-class variance σ²ᵦ(T) = ω₁(T)·ω₂(T)·[μ₁(T) - μ₂(T)]²
4.Select the optimal threshold T* that maximizes the between-class variance
σ²ᵦ(T)

I = imread('house.jpg');
T = graythresh(I);
BW = im2bw(I, T);
imshow(I);
figure; imshow(BW)
I = imread('coins.bmp');
T = graythresh(I);
BW = im2bw(I, T);
imshow(I);
figure; imshow(BW)

% Read image
I = imread('circle.jpg');
% Show imageimshow(I);
% Calculate two threshold values
thresh = multithresh(I, 2);
%Image segmentation into three levels with imquantize
function
seg_I = imquantize(I,thresh);
% Convert segmented images to color images by using the
label2rgb function and display
RGB = label2rgb(seg_I);
figure;imshow(RGB)
axis off
title('RGB Segmented Image')
2. Region Growing
Region growing is a pixel-based image segmentation
method that starts with a set of "seed" points and grows
regions by appending neighboring pixels that satisfy
predefined similarity criteria.
Core Concept
The fundamental idea of region growing is to start with one
or more seed points and incrementally add similar
neighboring pixels to form coherent regions. The process
continues until no more pixels can be added to any region.
Algorithm Steps
1.Seed Selection: Choose one or more initial seed pixels.
These can be selected manually, randomly, or based on
certain criteria.
2.Region Expansion:
o Examine the neighboring pixels of each seed.
o Add neighboring pixels to the region if they satisfy
similarity criteria.
o Each added pixel becomes a new seed for further
expansion.
3.Stopping Criteria: Continue until no more pixels can be
added to any region based on the similarity criteria.
Similarity Criteria
Common similarity measures include:
•Pixel intensity difference (less than a threshold)
•Statistical properties like mean and standard
deviation
•Texture features
•Color similarity in multi-channel images
2. Region Growing
• Usually statistical tests are used to decide whether
or not a pixel can be joined into a region.
• Advantages: having good connectivity between
pixels within the region
• Disadvantages:
- the right selection of seed
- criteria for quitting
- consuming a long time
Unseeded Region Growing
• Region growing method without feed specification
• Using a fast scanning algorithm

Sumber:主講人:張緯德, Image segmentation, Representation, and Description


Final step:
Merge small regions
become a large region

Sumber:主講人:張緯德, Image segmentation, Representation, and Description


3. Split and Merge
The split and merge algorithm takes a different approach by
recursively dividing the image into quadrants (splitting) and
then merging similar adjacent regions.
Core Concept
This algorithm operates on the principle of divide-and-
conquer:
•Split Phase: Recursively divide the image into quadrants
until each quadrant satisfies a homogeneity criterion.
•Merge Phase: Combine adjacent regions that satisfy
similarity criteria.
Algorithm Steps
1.Initial Region: Start with the entire image as a single region.
2.Split Phase:
o If a region is not homogeneous (fails the predicate test), split it into four
quadrants.
o Recursively apply this process to each quadrant.
o Continue until all regions satisfy the homogeneity criterion or reach
minimum size.
3.Merge Phase:
o Examine all adjacent regions.
o Merge regions if their combination satisfies the homogeneity criterion.
o Continue until no more regions can be merged.
4.Optional Refinement:
o Small regions may be merged with their most similar neighbors.
o Holes may be filled.
3. Split and Merge

• Using the split and merge algorithm


• The image is split into a number of disjoint
regions
• Merging homogeneous neighboring regions
Split and Merge Algorithm

You might also like