digital image processing in the name of god digital image processing lecture8: image segmentation m....

40
In The Name Of God Digital Image Processing Digital Image Processing Lecture8: Image Segmentation By: M. Ghelich Oghli M. Ghelich Oghli E-mail: E-mail: [email protected] [email protected] Fall 2012

Upload: edwin-morris

Post on 30-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 2: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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.

Page 3: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Detection of Discontinuity

• Point Detection

Page 4: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Detection of Discontinuity

• Line Detection

Page 5: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Example of Line Detection

Page 6: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Detection of Discontinuity

• Edge Detection: detection of discontinuity in image• Edge Model

Page 7: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Edge Detection• using first order derivatives• using second order derivatives

Page 8: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Noise effect in Edge Detection

Result: noise filtering is required especially in second order derivatives

Page 9: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Gradient operators

Page 10: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Edge Detection (first order derivatives)

Page 11: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Edge Detection (Second order derivatives)

• Laplacian

• Laplacian of Gaussian (LoG)

Page 12: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Edge Detection (LoG)

Page 13: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Image Segmentation

1. Hard segmentationA pixel belongs to object or background

Page 14: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Image Segmentation

2. Soft (Fuzzy) segmentation

First class Second class Third class

Page 15: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Image Segmentation

Image Segmentation methods

•Pixel based methods

•Region based methods

•Clustering segmentation methods

•Boundary detection

•Texture segmentation

Page 16: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 17: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Thresholding

• Foundation:

Page 18: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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)

Page 19: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 20: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Global Thresholding

Page 21: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Multi level Thresholding

Page 22: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Adaptive Thresholding

Advantage: Alleviates the illumination problem

Method: Divides the original image to subimages and applies threshold to each subimage individually

Page 23: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Adaptive Thresholding

Page 24: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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.

Page 25: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 26: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 27: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 28: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 29: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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)

Page 30: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Image Segmentation

Clustering segmentation methodsSubdividing data's into classes based on some criteria's.

Page 31: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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.

Page 32: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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

Page 33: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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.

Page 34: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Fuzzy C-Means (FCM)

Page 35: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Fuzzy C-Means (FCM)

Page 36: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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.

Page 37: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Boundary Detectionor

Curve Fitting

Page 38: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Boundary Detectionor

Curve Fitting

Drawback(Speckle Noise)

Example

Page 39: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

Deformable models– Parametric Deformable models (Snake)

– Geometric Deformable models (Level set)

Boundary Detectionor

Curve Fitting

Page 40: Digital Image Processing In The Name Of God Digital Image Processing Lecture8: Image Segmentation M. Ghelich Oghli By: M. Ghelich Oghli E-mail: m.g31_mesu@yahoo.com

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 …