Download presentation
Presentation is loading. Please wait.
Published byHilary Elliott Modified over 9 years ago
1
1 An Efficiently Computable Metric for Comparing Polygonal Shapes Esther M. Arkin, L. Paul Chew, Daniel P. Huttenlocher, Klara Kedem, Joseph S.B. Mitchell Liron Katav, Ilya Mirsky A B C D
2
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/20102
3
Introduction Model-based recognition is concerned with comparing a shape A, which is stored as a model for some particular object, with a shape B, which is found to exist in an image. If A and B are close to be the same object, then the vision system should report a match and return a measure of how good the match is. 27/12/20103 A model of a circle
4
Introduction (cont’d) To be useful this measure should satisfy several properties: It should be a metric. It should be invariant under translation, rotation, scaling, in other words it should measure shape alone. It should be reasonably easy to compute. It should match our intuition (i.e., answers should be similar to those that a person might give). It should be insensitive to small perturbations. 27/12/20104
5
Introduction (cont’d) 27/12/20105
6
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/20106
7
Definitions 27/12/20107
8
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/20108
9
Representation of Polygons 27/12/20109 O V4V4 V3V3 V2V2 V1V1 x axis O
10
Representation of Polygons (cont’d) 27/12/201010 s O O V3V3 V2V2 x axis V1V1 V1V1 V2V2 V3V3
11
Representation of Polygons (cont’d) 27/12/201011 The turning function The turning function accumulates turns. Notice that it increases with left-hand turns, and decreases with right-hand turns. s 1 a b c d e f 0 x axis a b c d e f
12
Representation of Polygons (cont’d) 27/12/201012
13
Representation of Polygons (cont’d) 27/12/201013
14
Representation of Polygons (cont’d) 27/12/201014
15
Representation of Polygons (cont’d) 27/12/201015 Rotation only affects the first angle v x axis s 1 0 s 1 0
16
Representation of Polygons (cont’d) Change of the reference point- Suppose the new reference point is at position s = t in the polygon before the change. In the new graph of the turning function, the actual angles and lengths remain the same, only the graph is shifted horizontally by t. 27/12/201016 s O 0 V3V3 V2V2 x axis V1V1
17
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/201017
18
Distance Function 27/12/201018
19
Distance Function (cont’d) 27/12/201019 Minimization Problem
20
Distance Function (cont’d) Observations: It’s a metric. It’s convex function- notice that d 2 (A, B) 2 is a sum of quadratic terms and is therefore a convex function. In order to compute the distance, we must minimize over all t's and θ 's. Notice also that a minimum for d 2 (A, B) is a minimum for d 2 (A, B) 2. Since the latter function is convex, it admits a single minimum. This means that for a given value of t, the optimum value of θ depends on this t only and is unique. Thus, we have but a single- variable minimization problem. 27/12/201020
21
Distance Function (cont’d) 27/12/201021
22
Distance Function (cont’d) Suppose we know this θ *(t). Then: 27/12/201022
23
Distance Function (cont’d) Now it remains to show how to compute | Θ A (s+t) - Θ B (s)| for each t. Note that Θ A (s+t) is a copy of Θ A (s) read from t to t+1. Since Θ A (s) can be defined over the whole real line (not just on [0, 1]), simply by repeating the pattern of the turning function infinitely to the left and to the right, with the pattern to the left increasing in height by 2 π for each unit and the pattern to the right decreasing in height by 2 π for each unit. 27/12/201023
24
Distance Function (cont’d) 27/12/201024 s 1 0 2
25
Distance Function (cont’d) Consider discontinuities of Θ A (s+t) and Θ B (s) in [0,1]. They make the rectangular strips made by the functions and the dashed lines. If polygon A has n vertices and polygon B has m vertices, then the number of "strips" made in this way is m + n - 1 (each vertex contributes a "step" of the turning angle function). 27/12/201025
26
Distance Function (cont’d) The portion between Θ A (s+t) and Θ B (s) over the interval ds forms a rectangular strip. In order to evaluate | Θ A (s+t) - Θ B (s)| over the interval ds, | Θ A (s+t) - Θ B (s)| is computed as the height of the rectangular strip and ds is computed as the width of this strip. For a given t, we may now evaluate d 2 (A, B), since we know how to compute | Θ A (s+t) - Θ B (s)|, ds, and since θ *(t) is computed from t. Finally, we take the minimum over all t's. Suppose the minimum distance occurs for some t*. Then the best match between the two turning functions Θ B (s) and Θ A (s) occurs when Θ A (s) is shifted horizontally by t* and vertically by θ *(t*). 27/12/201026
27
Observations: 27/12/201027 During the shifting operation the breakpoints of Θ A (s+t) collide with the breakpoints of Θ B (s ). We define a critical event as a value of t where such colliding occurs. There are m*n critical events. The distance function achieves its minimum at one of the critical events. So, we get m*n possible values for t. This is the number of ways in which a discontinuity of Θ A (s) can be aligned with a discontinuity of Θ B (s)
28
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/201028
29
Algorithm Description 27/12/201029 1. For each of the mn critical events t for Θ A (s) and Θ B (s): 1.1. Find the function Θ A (s+t) 1.2. For each of the m+n-1 rectangular strips made by Θ A (s+t) and Θ B (s): 1.2.1. Compute the height | Θ A (s+t) - Θ B (s)|, width ds, and θ *(t) 1.2.2. Get a final answer for the distance for this value of t 1.3. Update the value of the current minimal distance 2. Return the minimum distance
30
Time Complexity 27/12/201030 Calculation of the function Θ A (s+t) for a given t takes constant time (using the trick with extending Θ A (s) to the whole real line). So does computing the height | Θ A (s+t) - Θ B (s)|, width ds, and θ *(t) within one rectangular strip, and also the updates of the distance take constant time. we conclude that the algorithm runs in O(nm(n+m)) time. The O(nm(n+m)) complexity could be improved to O(nmlog(nm)) by using more complex algorithm.
31
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/201031
32
Examples 27/12/201032
33
Examples 27/12/201033 Distance : 0.485 Horizontal shift: 0.319 Vertical shift:-1.928
34
Examples 27/12/201034
35
Examples 27/12/201035 Distance : 0.847 Horizontal shift: 0.999 Vertical shift:-6.174
36
Examples 27/12/201036 Distance : 0.963 Horizontal shift: 0.228 Vertical shift:-2.03
37
Examples 27/12/201037 Resemblance to square and triangle, in decreasing order Distance from original shape
38
Outline 1. Introduction 2. Definitions 3. Representation of Polygons 4. Distance Function 5. The Algorithm 6. Examples 7. References 27/12/201038
39
References 27/12/201039 Esther M. Arkin, L. Paul Chew, Daniel P. Huttenlocher, Klara Kedem, Joseph S.B. Mitchell; “An Efficiently Computable Metric for Comparing Polygonal Shapes”, 1991. http://www.cim.mcgill.ca/~sveta/pr/ http://www.cim.mcgill.ca/~sveta/pr/ http://www.wikipedia.org http://www.wikipedia.org
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.