<< Image_Processing_Tool_3 Image_Processing_Tool_3 adapthresh >>

Image_Processing_Tool_3 >> Image_Processing_Tool_3 > emaxseg

emaxseg

Segment a gray scale image using Expectation Maximization clustering method.

Calling Sequence

[cma,cm] = emaxseg(img,k)

Parameters

img

A matrix representing the gray scale image.

k

A scalar representing the numbers of clusters into which image is to classified or segmented.

cma

A matrix representing the segmented image.

cm

A vector representing the pixel values correspoding to cluster centers.

Description

It segments a gray level image or matrix img into k clusters using Expectation Maximization technique. It is similar to K-means clustering in the sense that it requires initial cluster centers to perfor the clustering operation. Initial cluster centers are generated from the specified number of clusters. The historam of the image is computed and the cluster centers are updated iteratively Expectaion Maximization technique by comparing the log likelyhoods computed before and after maximization at each iteration. If difference between the loglikelyhood is less than a set threshold, the algorithm exits and updated cluster centers are used to segment the image.

Examples

x=imread('lena.png'); // reading an image
x=rgb2gray(x);  // converting the rgb image to gray scale image
x=double(x); // converting to double type
[y,c]=emaxseg(x,5); // Segment x into five cluster image y
imshow(uint8(y)); // Displaying the Segmented image y

See Also

Authors

Bibliography

http://www.seanborman.com/publications/EM_algorithm.pdf

<< Image_Processing_Tool_3 Image_Processing_Tool_3 adapthresh >>