0% found this document useful (0 votes)
57 views9 pages

Segmentation, Edge& Line Detection: Step in Image Analysis

The document discusses image segmentation techniques. It begins by explaining that image segmentation partitions an image into meaningful regions or objects. The goals of segmentation are to locate objects and boundaries. It then describes thresholding techniques, including single and double thresholding. Region growing is also covered, where regions are generated by adding similar neighboring pixels to seed pixels. The document ends by discussing clustering methods for segmentation, specifically the k-means algorithm which aims to minimize distances between points and cluster centers.
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)
57 views9 pages

Segmentation, Edge& Line Detection: Step in Image Analysis

The document discusses image segmentation techniques. It begins by explaining that image segmentation partitions an image into meaningful regions or objects. The goals of segmentation are to locate objects and boundaries. It then describes thresholding techniques, including single and double thresholding. Region growing is also covered, where regions are generated by adding similar neighboring pixels to seed pixels. The document ends by discussing clustering methods for segmentation, specifically the k-means algorithm which aims to minimize distances between points and cluster centers.
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/ 9

Dr.Azmi T.

Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Segmentation, Edge& Line Detection


The image analysis process requires us to take vast amounts of low-level
pixel data and extract useful information. Image segmentation is a key
step in image analysis. The steps of image analysis as shown in figure 1.

Figure 1: The steps of image analysis


Goal of image segmentation:
The goal of image segmentation to partition an image into a collection of
set of pixels or subdivides an image into its components to find regions
that representation of an image into something that is more
-Meaningful regions of objects (coherent objects).
– Linear structures (line, curve, …)
– Shapes (circles, ellipses, …)
The segmentation operation only subdivides an image; it does not attempt
to recognize the segmented image parts.

1
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Image segmentation creates segments of connected pixels by analyzing


some similarity criteria and the algorithms are modifications, extensions,
or combinations of these two basic concepts. The homogeneity and
contrast measures can include features such as gray level, color, texture,
and histogram as shown in figure 1.

Figure 1. Image segmentation to creates segments of image.

Applications:
• Machine Vision
• Medical Imaging applications (tumor delineation,)
• Object detection (face detection,…)
• 3D Reconstruction
• Object/Motion Tracking
• Object-based measurements such as size and shape
• Object recognition (face recognition,…)
• Fingerprint recognition,
• Video surveillance

2
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Image Binarization:
Image binarization applies often just one global threshold T for mapping
a scalar image I into a binary image.
Thresholding is a vital part of image segmentation, where we wish to
isolate objects from the background. A grayscale image is turned into a
binary (black and white) image according to whether its grey value is
greater than or less than T as shown in figure 2.
A pixels become becomes white if its gray level > T.
A pixels become becomes black if its gray level <=T
0 𝑖𝑓 𝐼(𝑥, 𝑦) ≤ 𝑇
𝑓 (𝑥, 𝑦) = { }
1 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Figure (2): Thresholded image of bacteria at T>100

This is called single thresholding , sometimes we need to find two


values and T1 and T2 apply a thresholding operation. Another
examples in enhancement the text of paper as shown in figure 3 and
finger print in figure 4.

3
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Figure 3: Text on a varying background, and threshold at T>100

Figure 4: Thresholding for finger print image.

A pixels become becomes white its gray level between T1 and T2.
A pixels become becomes black if its gray level is otherwise.
This called double thresholding as shown if figure 5.

Figure 5. The image spine.tif an the result after double


thresholding (T1 >115 & T2<125).

4
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Most frequently employed method for determining threshold is


based on histogram analysis of intensity levels as shown in figure 6.

Figure 6. Histogram to dark and brightness objects.


Optimum Threshold:
Suppose an image contains two intensity values m1, m2 combined with
additive Gaussian noise N(0,σ) that appear in an image with apriority
probabilities P1 and P2 correspondingly P1 + P2=1 as shown in figure 7.

Figure 7: Distribution of two region with p1&p2

5
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

The task is to define a threshold level T that would minimize the overall
segmentation error.

If P1 =P2 , the optimal threshold is the average of the image intensities.


In computer vision, image segmentation is one of the oldest and most
widely studied problems. There are several methods of segmentation as
shown in figure 8.

Figure 8: Segmentation methods in digital images.

Image segmentation techniques can be divided into three main


categories:
1-region growing and shrinking.
The region growing and shrinking methods use the row and column, (r,
c),-based spatial domain.

6
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

Region:
- A group of connected pixels with similar properties.
-Closed boundaries.
-Computation of regions is based on similarity.
-Regions may correspond to Objects in a scene or parts of objects.
- Spatial proximity + similarity.
For segment generation in grey-level or color images, we may start at one
seed pixel (x,y, I(x,y)) and add recursively adjacent pixels that satisfy a
“similarity criterion” with pixels contained in the so-far grown region
around the seed pixel.
|𝑧(𝑥, 𝑦) − 𝑚𝑖 | ≤ 2𝜎𝑖
where: z(x,y) is a gray level in (x,y) coordinate, mi , σi are the mean and
standard variation of the analyzed region.
Seeded Segmentation (Region Growing)
1. Choose the seed pixel
2. Check the neighboring pixels and add them to the region if they are
similar to the seed
3. Repeat step 2 for each of the newly added pixels; stop if no more pixels
can be added

Example: Segment the image A by using seeded segmentation.


The seeded pixels are 1 and 7
7−1
𝑚= =3
2
7
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

(A) Original Image Segmentation Image


0 0 5 6 7 a a b b b
1 1 5 8 7 a a b b b
0 1 6 7 7 a a b b b
2 0 7 6 6 a a b b b
0 1 5 6 5 a a b b b

2- Clustering methods.
The clustering techniques can be applied to any domain, such as
any N-dimensional color or feature space, whose components may even
include the spatial domain’s (r,c) coordinates.
The region growing and shrinking category can be considered a subset
of the clustering methods, but is limited to the spatial domain.
What is clustering?
 Organizing data into classes such that:
– High intra-class similarity.
– Low inter-class similarity.
 Finding the class labels and the number of classes directly from the
data (as opposed to classification tasks).
What is similarity?
Cluster by features
• Color • Intensity • Location • Texture.

K-Means clustering algorithm:


8
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.9

There are different methods and one of the most popular methods is K-
Means clustering algorithm.
The objective of K-Means clustering is to minimize the sum of squared
distances between all points and the cluster center.
Steps in K-Means algorithm:
1. Choose the number of clusters K.
2. Select at random K points, the centroids(not necessarily from your
dataset).
3. Assign each data point to the closest centroid → that forms K clusters.
4. Compute and place the new centroid of each cluster.
5. Reassign each data point to the new closest centroid. If any
reassignment. took place, go to step 4, otherwise, the model is ready.

You might also like