Download presentation
Presentation is loading. Please wait.
Published byGarey Laurence Stevens Modified over 9 years ago
1
Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003
2
Index of Topics Introduction of Problem Target & Chip Model Algorithms Overlay Search Breadth-first vs. Depth-first Graph Model Recursion for ‘deep compare’ Conclusion
3
Introduction of Problem IBM needs help Need algorithm to find all occurrences of a simple pattern within larger pattern Data describes geometric layout Uses only rectilinear shapes
4
Target & Chip Model Smaller pattern is our ‘target’
5
Target & Chip Model Larger pattern is our ‘chip’
6
Algorithms Program broken into two parts Read in data and optimize (overlay) Perform search (deep compare)
7
Algorithms Read data into appropriate data structures Vertex table Edge table Face table Shapes are on different layers that overlap Needed to ‘flatten’ representation
8
Overlay Algorithm Have: Want:
9
Overlay Algorithm We used the Plane Sweep Algorithm Computational Geometry: Algorithms and Applications by M. de Berg et al [pages 20 – 38] Start at highest horizontal edge Go to next highest, and so on Keep track of active vertical edges Test for intersection(s)
10
Plane Sweep Algorithm
12
Intersection Found
13
Plane Sweep Algorithm Intersection Found
14
Plane Sweep Algorithm
15
Overlay Algorithm get all horizontal edges and sort into list for each horizontal edge in list { remove inactive vertical edges;//active edges now above activeH add active vertical edges;//vert. edges starting @ activeH for each active vertical edge { test_intersection(activeH, activeV); if(intersection == true) update tables with new values; }
16
Search Ready to compare target & chip data Can be solved with recursion But where to start? Target ‘key’ Face in target with the largest # edges Most unique more definitive search
17
Search Now that we have starting point How to search Breadth-first search Requires a lot of memory Depth-first search Less memory needed Need a finite tree to search
18
Breadth-first Search
23
Depth-first Search
27
Can throw away this sub-tree
28
Graph Model Now we need to represent the patterns in such a way that we can use one of these searches Visualize a tree Root node is target ‘key’ Each neighboring face becomes a child node Recursively iterate through pattern
29
Graph Model f1 f2f3 f4 e f1 e f2f3 e f4 e e e Abstract Tree
30
Graph Model Don’t need to represent multiple shared edges Mark faces & edges as ‘visited’ once checked f1 e f2f3ee ef2 ee Concrete Tree (repetitive edges)
31
Recursive ‘Deep Compare’ Use recursion on abstract trees Start with key and possible match
32
Deep Compare Algorithm get list of possible matches (those equivalent to target key) for each face in list { if(deepCompare(t-key, cface)); keep face in list } bool deepCompare(tface, cface) { if(tface == cface) { do{ new-cface = get next neighbor of cface new-tface = get next neighbor of tface if not (deepCompare(new-cface, new-tface)) return false; }while still have unvisited neighbors; return true; } return false; }
33
Search If deepCompare is true for possible match Then candidate is a final match and is flagged Else Removed from the list At end all matches are flagged
34
Conclusion Algorithm can be adapted for other input data We’re allowed conveniences by having rectilinear shapes (less detail and overhead) Using plane-sweep algo. saves on runtime Now log(n) not n 2
35
Conclusion Good choice for target ‘key’ quickly decreases search space Depth-first search saves on memory
36
The End Created: April 4, 2003
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.