Project Report On Image Segmentation
Project Report On Image Segmentation
Introduction
Segmentation is an important step in the process
of image analysis. During this transform the
image is divided into parts that correspond with
objects or areas of the real world contained in
the image. A complete segmentation defines a set
of disjoint regions uniquely corresponding with
objects in the input image, while a partial
segmentation divides an image area to regions
not directly corresponding with objects but, for
example, with the classes of objects .An example
of such approach is clustering also known as
pixel classification. In this group of algorithms,
the image is processed globally by assigning
each pixel to one of the defined classes, for
example objects A, objects B, or background,
without respect to object consistence. The
technique is often based on thresholding the
intensity level of each pixel. Finding an optimal
range of intensity allows separating the
background from the objects. More
sophisticated clustering algorithms are based on
image intensity histograms. Such a concept
Figure 1. image.jpg
Coding
close all
clear all
%Read the source RGB image
x = imread('images.jpg');
figure; imshow(x)
[r,c,s] = size(x);
sample_region(:,:,count) = roipoly(x);end
close(f);
color_label = 0:nclasses-1;
a = double(a);
b = double(b);
figure
d = repmat(0,[size(a),nclasses]);
imshow(sample_region(:,:,count));
%Perform classification
end
(b -color_maker(count,2)).^2 ).^0.5;
end
lab_x = applycform(x,cform);
[value,label] = min(d,[],3);
label = color_label(label);
%clear value distance;
a = lab_x(:,:,2);
b = lab_x(:,:,3);
y = zeros(size(x));
l = double(label)+1 ;
for m = 1 : r
for n = 1: c
y(m,n,:) = color(l(m,n),:);
ylabel('''b*'' values');
end
end
Conclusion
figure ; imshow(y)
colorbar
%scatter plot
classification
for
the
nearest
neighbour
plot_labels{count},'markerfacecolor',
plot_labels{count});
hold on ;
end
title('ScatterPlot of the segmented pixels in ''a*b*''
space');
xlabel('''a*'' values ');
Reference
[1] course slide
[2]https://www.mathworks.com/matlabcentral/filee
xchange/46117-k-nearest-neighbors-for-imagesegmentation
[3]https://www.youtube.com/watch?
v=3hEvcyCJNRc