rectilinear pattern recognition dan j. nardi masters thesis april 11, 2003
TRANSCRIPT
![Page 1: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/1.jpg)
Rectilinear Pattern Recognition
Dan J. Nardi
Masters Thesis
April 11, 2003
![Page 2: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/2.jpg)
Index of Topics
Introduction of Problem Target & Chip Model Algorithms
Overlay Search
Breadth-first vs. Depth-first Graph Model Recursion for ‘deep compare’
Conclusion
![Page 3: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/3.jpg)
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
![Page 4: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/4.jpg)
Target & Chip Model
Smaller pattern is our ‘target’
![Page 5: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/5.jpg)
Target & Chip Model
Larger pattern is our ‘chip’
![Page 6: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/6.jpg)
Algorithms
Program broken into two parts
Read in data and optimize (overlay)
Perform search (deep compare)
![Page 7: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/7.jpg)
Algorithms
Read data into appropriate data structures Vertex table Edge table Face table
Shapes are on different layers that overlap
Needed to ‘flatten’ representation
![Page 8: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/8.jpg)
Overlay Algorithm
Have:
Want:
![Page 9: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/9.jpg)
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)
![Page 10: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/10.jpg)
Plane Sweep Algorithm
![Page 11: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/11.jpg)
Plane Sweep Algorithm
![Page 12: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/12.jpg)
Plane Sweep Algorithm
Intersection Found
![Page 13: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/13.jpg)
Plane Sweep Algorithm
Intersection Found
![Page 14: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/14.jpg)
Plane Sweep Algorithm
![Page 15: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/15.jpg)
Overlay Algorithm
get all horizontal edges and sort into list
for each horizontal edge in list{
remove inactive vertical edges; //active edges now above activeHadd active vertical edges; //vert. edges starting @ activeH
for each active vertical edge{
test_intersection(activeH, activeV);if(intersection == true)
update tables with new values;}
}
![Page 16: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/16.jpg)
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
![Page 17: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/17.jpg)
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
![Page 18: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/18.jpg)
Breadth-first Search
![Page 19: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/19.jpg)
Breadth-first Search
![Page 20: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/20.jpg)
Breadth-first Search
![Page 21: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/21.jpg)
Breadth-first Search
![Page 22: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/22.jpg)
Breadth-first Search
![Page 23: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/23.jpg)
Depth-first Search
![Page 24: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/24.jpg)
Depth-first Search
![Page 25: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/25.jpg)
Depth-first Search
![Page 26: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/26.jpg)
Depth-first Search
![Page 27: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/27.jpg)
Depth-first Search
Can throw away this sub-tree
![Page 28: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/28.jpg)
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
![Page 29: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/29.jpg)
Graph Model
f1
f2 f3
f4
e
f1
e f2 f3
e f4 e f4
e e
Abstract Tree
![Page 30: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/30.jpg)
Graph Model
Don’t need to represent multiple shared edges Mark faces & edges as ‘visited’ once checked
f1
e f2f3e e f3 f3 e f2 f2 e e
Concrete Tree (repetitive edges)
![Page 31: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/31.jpg)
Recursive ‘Deep Compare’
Use recursion on abstract trees
Start with key and possible match
![Page 32: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/32.jpg)
Deep Compare Algorithmget 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 cfacenew-tface = get next neighbor of tface
if not (deepCompare(new-cface, new-tface))return false;
}while still have unvisited neighbors;
return true;}return false;
}
![Page 33: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/33.jpg)
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
![Page 34: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/34.jpg)
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 n2
![Page 35: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/35.jpg)
Conclusion
Good choice for target ‘key’ quickly decreases search space
Depth-first search saves on memory
![Page 36: Rectilinear Pattern Recognition Dan J. Nardi Masters Thesis April 11, 2003](https://reader036.vdocuments.us/reader036/viewer/2022081514/56649d1f5503460f949f3d66/html5/thumbnails/36.jpg)
The End
Created: April 4, 2003