In The Name Of God
Digital Image ProcessingDigital Image Processing
Lecture8:
Image Segmentation
By: M. Ghelich OghliM. Ghelich OghliE-mail: E-mail: [email protected][email protected]
Fall 2012
Image Segmentation
• Description: Subdividing image into its constituent regions or objects
•There is not any absolute theory of image segmentation.
Rather, there are a collection of methods that have received some degree of popularity.
Detection of Discontinuity
• Point Detection
Detection of Discontinuity
• Line Detection
Example of Line Detection
Detection of Discontinuity
• Edge Detection: detection of discontinuity in image• Edge Model
Edge Detection• using first order derivatives• using second order derivatives
Noise effect in Edge Detection
Result: noise filtering is required especially in second order derivatives
Gradient operators
Edge Detection (first order derivatives)
Edge Detection (Second order derivatives)
• Laplacian
• Laplacian of Gaussian (LoG)
Edge Detection (LoG)
Image Segmentation
1. Hard segmentationA pixel belongs to object or background
Image Segmentation
2. Soft (Fuzzy) segmentation
First class Second class Third class
Image Segmentation
Image Segmentation methods
•Pixel based methods
•Region based methods
•Clustering segmentation methods
•Boundary detection
•Texture segmentation
Image Segmentation
Pixel based methodsConceptually, the simplest approach we can take for
segmentation.
But, it is not the best method.
The most sensible example of this category:
Thresholding
Thresholding
• Foundation:
Thresholding
• In A: light objects in dark background
• To extract the objects:
– Select a T that separates the objects from the background
– i.e. any (x,y) for which f(x,y)>T is an object point.
• A thresholded image:
(objects)
(background)
Thresholding
• In B: a more general case of this approach (multilevel thresholding)
• So: (x,y) belongs:
– To one object class if T1<f(x,y)≤T2
– To the other if f(x,y)>T2
– To the background if f(x,y)≤T1
Global Thresholding
Multi level Thresholding
Adaptive Thresholding
Advantage: Alleviates the illumination problem
Method: Divides the original image to subimages and applies threshold to each subimage individually
Adaptive Thresholding
Image Segmentation
Region based methodsRegion based methods doesn’t include one of the most
important disadvantage of pixel-based techniques and it is
ignoring pixel relationships and connectivity.
An object consists of not independent and not isolated
pixels.
A robust segmentation method should consider this fact.
Region Growing
In this method neighboring pixels of similar amplitude
are grouped together to form a segmented region.
Image segmentation partitions the set X into the subsets R(i), i=1,
…,N having the following properties
• X = i=1,..N U R(i)
• R(i) ∩ R(j) = 0 for i ≠ j
• P(R(i)) = TRUE for i = 1,2,…,N
• P(R(i) U R(j)) = FALSE for i ≠ j
Region Growing by Pixel Aggregation
• A simple approach to image segmentation is to start from some pixels (seeds) representing distinct image regions and to grow them, until they cover the entire image
• For region growing we need a rule describing a growth mechanism and a rule checking the homogeneity of the regions after each growth step
Region Growing by Pixel Aggregation
• The growth mechanism – at each stage k and for each region Ri(k), i = 1,…,N, we check if there are unclassified pixels in the 8-neighbourhood of each pixel of the region border
• Before assigning such a pixel x to a region Ri(k),we check if the region homogeneity:
P(Ri(k) U {x}) = TRUE , is valid
Gray Space map
Compute the seed gray level (V) and look for pixels have the same gray level and over lap the seed
Then define a set of gray levels from “V-D” to “V+D”
Region Growing by Pixel Aggregation
Ghelich Oghli, M., Fallahi, A., Pooyan, M. Automatic Region Growing Method using GSmap and Spatial Information on Ultrasound Images. In: 18th Iranian Conference on Electrical Engineering, May 11-13, pp. 35-38 (2010)
At each iteration we increase the difference D by 1
Region Growing by Pixel Aggregation
Ghelich Oghli, M., Fallahi, A., Pooyan, M. Automatic Region Growing Method using GSmap and Spatial Information on Ultrasound Images. In: 18th Iranian Conference on Electrical Engineering, May 11-13, pp. 35-38 (2010)
Image Segmentation
Clustering segmentation methodsSubdividing data's into classes based on some criteria's.
K-Means Clustering
1. Set ic (iteration count) to 1
2. Choose randomly a set of K means m1(1), …, mK(1) (Center
of Classes).
3. For each pixel compute D(xi , mk(ic)), k=1,…K and assign
xi to the cluster Cj with nearest mean.
4. Increment ic by 1, update the means to get m1(ic),…,mK(ic).
5. Repeat steps 3 and 4 until Ck(ic) = Ck(ic+1) for all k.
K-Means Clustering
In some applications (Specially medical application)
because of effect of other slices, absolutely assigning a
pixel to a class is not logically true.
So, we should classify data's by a fuzziness view.
And we should use:
Fuzzy C-Means (FCM)
algorithm
Fuzzy C-Means (FCM)
•A membership function exists for each class at every pixel location
0; if the pixel does not belong to the class
1; if the pixel belongs, with absolute certainty, to the class
0-1; degree of belonging a pixel to a class
at any pixel location the sum of the membership functions
of all the classes must be 1
The fuzzy membership function reflects the similarity
between the data value at that pixel and the value of the
class centroid.
Fuzzy C-Means (FCM)
Fuzzy C-Means (FCM)
Boundary Detectionor
Curve Fitting • It is possible to segment an image into regions of common
attribute by detecting the boundary of each region for which there is a significant change in attribute across the boundary.
• Methodology
Initial guess
Iteratively deforming curves according to the minimization of
internal and external energy functional and controls the smoothness of the curve.
Boundary Detectionor
Curve Fitting
Boundary Detectionor
Curve Fitting
Drawback(Speckle Noise)
Example
Deformable models– Parametric Deformable models (Snake)
– Geometric Deformable models (Level set)
Boundary Detectionor
Curve Fitting
LevelsetThis figure illustrates several important ideas about the level set method.
A bounded regionBoundary=zero level set
Graph of a level set function
Changing (Evolving) in Region…
Moving X-Y plane through …