+ All Categories
Home > Documents > Image Segmentation in Color Space By Anisa Chaudhary.

Image Segmentation in Color Space By Anisa Chaudhary.

Date post: 17-Jan-2016
Category:
Upload: mariah-moody
View: 229 times
Download: 0 times
Share this document with a friend
Popular Tags:
27
Image Segmentation in Color Space By Anisa Chaudhary
Transcript
Page 1: Image Segmentation in Color Space By Anisa Chaudhary.

Image Segmentation in Color SpaceBy Anisa Chaudhary

Page 2: Image Segmentation in Color Space By Anisa Chaudhary.

So what Is Image Segmentation?

•Partitioning an image into its several constituents is called “Segmentation”.•Segmentation is the fundamental step in analyzing and Understanding Images.It may be defined as decomposing an image into its constituent parts extracting the location and the outline of Objects Of interests.

Example:

Page 3: Image Segmentation in Color Space By Anisa Chaudhary.

And what is color Segmentation?

The Techniques for Image segmentation can be extended to Colored Images.IThe ages

The Common approaches for Color Segmentation are : Pixel Based Segmentation

• Thresholding with Pixel Value Average . • Clustering K-means Algorithm Area Based Segmentation• Region Growing Edge Based Segmentation Physics Based Segmentation

Page 4: Image Segmentation in Color Space By Anisa Chaudhary.

What am I doing?My projects works with six example Images and four Segmentation algorithms which segments color images.

I implemented these different segmentation algorithms on each of the six image and finally compared all the algorithms.

The algorithms used in my project are: Watershed algorithmKmeans clustering algorithm and Region growing Algorithm.Finally I have implemented the simple histogram thresholding as well.

I have used GUI in Matlab to implement and compare the algorithms.

Page 5: Image Segmentation in Color Space By Anisa Chaudhary.

What about GUI?(Or Graphical User Interface)

GUIDE , the Matlab Graphical User Interface development environment provides a set of tools such as pushbutton , axes ,Slides etc.

The shown figure is a Layout Editor which is the control panel for all GUIDE tools. It enables you to Layout a GUI quickly and easily by

Dragging components as axes, textbox from the component palette into the layout area.

You can program the GUI with the M-file Editor and when you press RUN the functioning GUI appears outside the Layout Editor window

Page 6: Image Segmentation in Color Space By Anisa Chaudhary.

My Matlab Demo

My slides have two axe first onedisplays the Original image and And the second displays the Segmented image.

You select an image by clicking on

the required image name in the list

box and the following figure is loaded in the first axes.

Click on the “segment” pushbutton,

the original image gets segmented

and is displayed in the second box.

The “quit” pushbutton closes the

image

Page 7: Image Segmentation in Color Space By Anisa Chaudhary.

Watershed Algorithm (Algorithm 1)

Watershed Segmentation gets its name from the manner in which the algorithm segment regions into Catchement basins

The term watershed refers to a ridge that divides areas drained by different river systems. A catchment basin is the geographical area draining into a river or reservoir.

The watershed transform requires that you think of an image as a surface If you imagine that bright areas are

"high" and dark areas are "low," then it might look like the surface (left). With surfaces, it is natural to think in terms of catchment basins and watershed lines.

Page 8: Image Segmentation in Color Space By Anisa Chaudhary.

Steps in Watershed Algorithm:

•Read in an Image and covert it in grayscale•Use the gradient magnitude as the segmentation function •Mark the foreground objects •Compute the Background markers•Compute the watershed transform of the segmentation function•Visualize the result.

p 2: Use the gradient magnitude as the segmentation function

The key behind using the watershed transform for segmentation is this: Change your image into another image whose catchment basins are the objects you want to identify.

Page 9: Image Segmentation in Color Space By Anisa Chaudhary.

But What If:

1. Read an image and convert it to gray scale

2. Use the gradient magnitude as the segmentation function Use the Sobel edge masks, “imfilter”, and some simple arithmetic

to compute the gradient magnitude. The gradient is high at the borders of the objects and low (mostly) inside the objects.

No. Without additional preprocessing such as the marker computations below, using the watershed transform directly often results in "oversegmentation”.

Can you segment the image by using the watershed transform directly on the gradient magnitude?

Page 10: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 1How my Watershed Algorithm proceeds on First image:

Page 11: Image Segmentation in Color Space By Anisa Chaudhary.

CONT’D

Page 12: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 1

Algorithm 1Slides

Page 13: Image Segmentation in Color Space By Anisa Chaudhary.

Another useful visualization technique is to display the label matrix as a color image in Watershed Algorithm . Label matrices, such as those produced by watershed and “bwlabel”, can be converted to truecolor images for visualization purposes by using “label2rgb”

Example::

Page 14: Image Segmentation in Color Space By Anisa Chaudhary.

(Algorithm 2)

Clustering Algorithm

The main objective of clustering is to find similarities between experiments or genes and then group similar samples or genes together to assist in understanding relationships that might exist among them.

Cluster analysis is based on a mathematical formulation of a measure of similarity.

•K-Mean•Jarvis-Patrick

ggloameHierarcalelf Organizingaps

•Agglomerative Hierarchical•Self Organizing maps

Some of the Clustering methods are as follows:

Page 15: Image Segmentation in Color Space By Anisa Chaudhary.

K-means Clustering AlgorithmK-Means clustering generates a specific number of disjoint, flat (non-hierarchical) clusters. It is well suited to generating globular clusters .The K-Means method is numerical, unsupervised, non-deterministic and iterative

The K-Means Algorithm Process• The dataset is partitioned into K clusters and the data points are randomly assigned to the clusters resulting in clusters that have roughly the same number of data points.•For each data point:•Calculate the distance from the data point to each cluster.•If the data point is closest to its own cluster, leave it where it is. If the data point is not closest to its own cluster, move it into the closest cluster.•Repeat the above step until a complete pass through all the data points results in no data point moving from one cluster to another. At this point the clusters are stable and the clustering process ends.•The choice of initial partition can greatly affect the final clusters that result, in terms of inter-cluster and intracluster distances and cohesion.

Page 16: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 2 SlidesAlgorithm 2 on all the images

Page 17: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 2 Slides

Page 18: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 2 Slides

Page 19: Image Segmentation in Color Space By Anisa Chaudhary.

(Algorithm 3)

Region Growing Algorithm

From Dr. Latecki Website

8

Region Growing

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 20: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 3 Slides

Page 21: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 3 Slides

Page 22: Image Segmentation in Color Space By Anisa Chaudhary.

(Algorithm 4)

Histogram Thresholding

If we take the histogram of the colored images , it can be seen that the images would have multiomodal histogram and therefore the simple thresholding does not hold good for them . The histogram has to analyzed and by hit and trial method the threshold value has to be determined.Therefore a new method is used here which chooses the Threshold value to be the pixel average value.

Page 23: Image Segmentation in Color Space By Anisa Chaudhary.

Algorithm 4 Slides

Page 24: Image Segmentation in Color Space By Anisa Chaudhary.

After trying the three Segmentation algorithms on six images , I have the following results::

In the K-means Algorithm •images were segmented neatly.•But It takes a minimum of 1:30 min for each image because of the iterations procedure that it performs.

Watershed Algorithm is fastest of all the three segmentation Algorithms .Visualization techniques using label2rgb worked for only one imageAnd for the rest of the image gave one color blank images

Results????

Page 25: Image Segmentation in Color Space By Anisa Chaudhary.

Region Growing Algorithm is •Simpler •but it has the problem of leakage in its segmented image.•It takes more time than both the above algorithms

In the Histogram Thresholding Algorithm •It is Simpler •It is faster •Segmentation is good

Page 26: Image Segmentation in Color Space By Anisa Chaudhary.

Images

Algorithms

WaterShed Region Growing

K-Means Histogram

Good Bad Best Good

Good Bad Best Good

Bad Bad Best Good

Bad Bad Best Good

Bad Bad Best Good

Good Bad Best Good

1

2

3

4

5

6

Page 27: Image Segmentation in Color Space By Anisa Chaudhary.

The watershed transform is often applied to the problem where there are separate touching objects in the image.

Example:

Conclusions!K-means Algorithm worked the best for me on the given images when we compare how well the images were segmented.

But if we compare the time taken by each algorithm , Watershed algorithm worked best for me.

The worst algorithm in both time and segmentation is Region Growing Algorithm


Recommended