1 / 22

Image segmentation by clustering in the color space

Image segmentation by clustering in the color space. CIS581 Final Project Student: Qifang Xu Advisor: Dr. Longin Jan Latecki. Content. Introduction Project Algorithm Project program Experiments and results Conclusion. Introduction.

lbrewington
Download Presentation

Image segmentation by clustering in the color space

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Image segmentation by clustering in the color space CIS581 Final Project Student: Qifang Xu Advisor: Dr. Longin Jan Latecki

  2. Content • Introduction • Project Algorithm • Project program • Experiments and results • Conclusion

  3. Introduction • Image segmentation is to find objects or meaningful part of objects. • Two types of segmentation methods • homogeneity • contrast • Image segmentation techniques • region growing and shrinking • clustering methods • Boundary detection

  4. Clustering Techniques • Segment an image by grouping each elements based on some measure of similarity • Domain spaces • spatial domain (row-column (rc) space) • color space • histogram spaces • other complex feature space

  5. Clustering Algorithms • Basic idea 1. Iteratively divide the space of interest into regions by median. 2. stop when the specific criteria is reached. k-means clustering • Recursive region splitting algorithm standard technique 1. compute histograms for each component of interest (red, green, blue) 2. select a best threshold to split the image into two regions 3. Repeat 1 and 2, until no new regions can be created

  6. Project Algorithm • A combination of the k-medoid algorithm and classification tree’s techniques • Feature space: RGB • Computation time is linear to the number of feature vectors • Flow chart for the project

  7. Project program (1) • Main file: rgbcluster.m firstauto3(inputFileName, mnp, percent) inputFileName: image for segmentation mnp: Minimal number of points in each cluster percent: parameter that delays clustering of points in a margin region. Value: 0.01-- 0.1. Normal value: 0.05. output: a set of clusters

  8. Project program (2) • Color index each entry: R G B weights weight is the number of pixels for this color function [colorWeights] = getStat(data, map) colorWeights = map; [row, col] = size(map); for i = 1:row tmp = find(data==i); colorWeights(i, col+1) = length(tmp); end return;

  9. Project program (3) • Means meanR = meanG = meanB =

  10. Codes for find rgb mean function [mn] = find_mean(data) [row, col] = size(data); sumR = 0; sumG = 0; sumB = 0; count = 0; for i = 1:row sumR = sumR + data(i, 1) * data(i, col); sumG = sumG + data(i, 2) * data(i, col); sumB = sumB + data(i, 3) * data(i, col); count = count + data(i, col); end thisMean(1) = sumR / count; thisMean(2) = sumG / count; thisMean(3) = sumB / count; mn = thisMean; return;

  11. Project program (4) • Distance: Euclidean distance between two points • Codes function [dist] = dist2pt(x, y) dist = sqrt((x(1)-y(1))^2 + (x(2)-y(2))^2 + (x(3)-y(3))^2); return;

  12. Project program (5) • Split2.m (provided by Dr. Latecki) [lmainindex,rmainindex,ldata,ldist,rdata,rdist,cluster,no,centroid] = split2(data,dist,a,mainindex,scale,mnp,percentage,cluster,no,centroid)

  13. Project program (6) • recurauto1.m: recursively split data into clusters (provided by Dr. Latecki) 1. distance histogram (myhist) 2. threshold (evo2) 3. split (split2) 4. find left distance, go to left branch 5. find right distance, go to right branch 6. no new split, stop • Unclustered points assigned to the clusters with closest distance to the centroids.

  14. Experiments and results • Rgb pictures • Cherry flowers • House • tiger • airplane • car • people

  15. Resluts 1 Original pictures segmented pictures Mnp: 30, percent 0.05, cluster number 4 Mnp : 20, percent 0.05, cluster number 7

  16. Results 2 Original pictures Segmented pictures Mnp: 10, percent 0.05, cluster number: 9 Mnp: 50, percent 0.05, cluster number: 3

  17. Results 3 Original pictures segmented pictures Mnp: 10, percent: 0.05, cluster number: 11 Mnp: 30 Percent: 0.05 Cluster number: 4

  18. Image size: 2MB, mnp: 30, cluster number: 5

  19. Original picture Mnp:10, cluster number: 15 Mnp: 30, Cluster number: 4

  20. Results movies

  21. Conclusion • Advantages • no predefined cluster number • user interactive • computation time • Disadvantages • spatial information lost • Cannot deal with noise or outliers

More Related