 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Problem: A running time of O(m3n2) may be
|
|
|
|
|
impractical
|
|
|
| • |
Idea:
Use hashing to separate the runtime factors
|
|
|
| • |
Preprocessing: [O(m3) time]
|
|
|
|
|
|
for
each pair (p,q) of pattern points
|
|
|
|
Transform all pattern points to reference
frame (p,q)
|
|
|
|
[i.e., reference frame with origin at
p, + X-axis through q];
|
|
|
for each pattern point r
|
|
|
|
Determine bin containing the
transformed r
|
|
|
|
Place (p,q) in Hashtable, hashed by bin
number of r
|
|