Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Vision Lecture 5. Clustering: Why and How.

Similar presentations


Presentation on theme: "Computer Vision Lecture 5. Clustering: Why and How."— Presentation transcript:

1 Computer Vision Lecture 5. Clustering: Why and How

2 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 1 This Lecture What is segmentation? 14.1 Segmentation and human vision 14.2 Background detection, scene changes 14.3 Segmentation through clustering 14.4 –Digital topology –Split and merge –k-means Graph theoretic segmentation 14.5 Hough transform 15.1

3 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 2 What is Segmentation? Examples –Scene change detection –Part search –Identification of humans –Search for buildings in satellite images –Search for images in databases

4 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 3 Formal Models of Segmentation Sub-processes –Image region generation –Curve segment detection –Point correspondence between two images Segmentation as clustering –Splitting –Merging

5 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 4 Gestalt Theories and Segmentation Gestalt theory: psychological theory of vision emphasizing how relations between visual objects affects their perception Examples of gestalt groupings: Basic image Nearness Color similarity Shape similarity Common behavior Common regionRegion grouping is stronger than nearness

6 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 5 Factors Affecting Grouping Parallel linesSymmetric LinesClosureContinuity

7 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 6 Shape Decides Figure-Ground Choice

8 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 7 Figure: Museum Background: Sky plus trees Goal: Identify background Segmentation by Histogram Strategy: Use red to identify trees, use blue to identify sky

9 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 8 Edit Detection

10 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 9 Clustering Preliminary processing produces binary image Identify connected groups of pixels in the image

11 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 10 Topological Clustering Given: Array with values 0 and -1 –Cells with 0 are unmarked (background), cells with -1 are marked (objects) Goal: Assign value 1 for all pixels in first object, value 2 in second object, etc. Topological principle: If a pixel is in object k, and another pixel is adjacent to it and is marked, then it is also in object k. 0 2 1 pixel values

12 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 11 Topological Clustering Algorithm topological_clusters { k = 1; p = coordinates_of_marked_pixel while (p != -1) { label_connected_pixels( p, k) k = k+1; p = coordinates_of_marked_pixel } coordinages_of_marked_pixel { for i = 1 to last { if val[i] == -1 return i; } return -1; }

13 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 12 Connected Pixel Labeling label_connected_pixels( p, k) { // label all marked // pixels connected to p with k val(p) = k; change = 1; while ( change == 1 ) { change = 0; for i = 1 to last { if (val[i] == -1) & (pixel_adjacent_to(i) == k) { val[i] = k; change = 1; } ) pixel i pixel adjacent to i

14 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 13 More General Clustering Given: Set of points Goal: Set of clusters Method (split and merge) While (stopping criterion not met) { –If (clusters to loose tight) split clusters –If (clusters too small) merge clusters } Many ideas, many algorithms Quality measures –Good if small number of clusters –Good if clusters are tight and/or well shaped

15 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 14 Adjacency Matrix Merge Adjacency Matrix

16 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 15 Merge Rules Find adjacency matrix d(i, j) = ||p i –p j || Merge: –Find smallest d(i, j) –Merge these two clusters. Call new cluster k –For all l ≠ i, j, d(l, k) = min(d(l, i), d(l, j))

17 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 16 k – Mean Clustering Assign data to k clusters Iteratively –Compute c i, means of clusters for i = 1... k –Re-assign data to the cluster associated with the closest mean

18 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 17 Graph-Based Segmentation Split image into parts Assign a graph vertex to each part Assign edges that measure similarity between parts Partition graph into components that are similar within component and different among components.

19 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 18 Advantages and Disadvantages Similarity measures can be chosen for the problem at hand –Similarity according to intensity –Similarity in color –Similarity in texture –Similarity in geometry No good method of choosing similarity measures and merging criteria

20 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 19 Model-Based Segmentation Method of segmentation should be chosen on the basis of model of objects being segmented We will consider clustering of straight lines from edge detection data

21 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 20 Hough Transform Coordinates of a line on a plane are The transform

22 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 21 Hough Coordinates Image of one point Hough transform

23 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 22 Line Detection

24 Computer Vision, Lecture 5 Oleh Tretiak © 2005Slide 23 Lines With and Without Noise


Download ppt "Computer Vision Lecture 5. Clustering: Why and How."

Similar presentations


Ads by Google