1 / 63

S C A L E D PATTERN MATCHING

S C A L E D PATTERN MATCHING. A.Amir Bar-Ilan Univ. & Georgia Tech A.Butman Holon College M.Lewenstein Bar-Ilan Univ. E.Porat Bar-Ilan Univ. . TEMPLATE. AERIAL PHOTO. SEARCHING FOR TEMPLATES IN AERIAL PHOTOGRAPHS. INPUT. TASK: Search for all locations where the template

kamal-wall
Download Presentation

S C A L E D PATTERN MATCHING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SCALED PATTERN MATCHING A.Amir Bar-Ilan Univ. & Georgia Tech A.Butman Holon College M.Lewenstein Bar-Ilan Univ. E.Porat Bar-Ilan Univ.

  2. TEMPLATE AERIAL PHOTO SEARCHING FOR TEMPLATES IN AERIAL PHOTOGRAPHS INPUT TASK: Search for all locations where the template appears in the image.

  3. local errors Theoretically, need to consider: • Noise • Occlusion • Scaling (size) • Rotation (orientation) We are interested in asymptotically efficient algorithms in pixel space.

  4. MODEL • Low Level (pixel level) avoid costly preprocessing • Asymptotically efficient solutions. • Serial, exact algorithms.

  5. Results: mismatches AL-88 edit distance, k errors, rectangular patterns edit distance, k errors, half-rectangular patterns AF-95 TYPES OF APPROXIMATIONS Local Errors: Level of detail Occlusion Noise

  6. Results: FU-98 ACL-98 TYPES OF APPROXIMATIONS Orientation

  7. A B C EVEN WITHOUT ERRORS AND ROTATIONS … DIGITIZING NEWSPAPER STORIES IDEA: Keep dictionary of fonts Search for appearances in all size.

  8. 1 2 3 4 5 PROBLEM INHERENTLY INEXACT What if appearance is 1½ times bigger ? What is ½ a pixel ? SOLUTIONS UNTIL NOW: NATURAL SCALES Consider only discrete scales

  9. How does one model for real scales?

  10. 1 2 3 4 5 6 7 T[1,1] T[1,2] T[1,3] 1 T[2,1] T[2,2] T[2,3] 2 T[3,1] T[3,2] T[3,3] 3 4 T[5,4] 5 6 T[7,7] 7 Step 1:Define grid & pixel centers. Example:Unit pixel array for a 77 array.

  11. Step 2:Define scaling. Example:33 array. Scaled To 1⅓

  12. Scaled To 1⅓

  13. Remark: • We only scale “up” Reasons: • Avoid conceptual problems of loss of resolution. • From “far enough” away everything looks the same.

  14. Let P be a mm pattern and T an nn text. How many different scaled patterns of P are there?

  15. In fact, can there be two different scaled patterns of P of size kk?

  16. Example: 5×5

  17. 4 x 1.1 = 4.4 Scaled by 1.1 to 6x6

  18. 4 x 1.125 = 4.5 Scaled by 1.125 to 6x6

  19. 3 x 1.17 = 3.51 Scaled by 1.17 to 6x6

  20. 2 x 1.25 = 2.5 Scaled by 1.25 to 6x6

  21. Let P be a mm pattern and T an nn text. How many different scaled patterns of P are there?

  22. Claim There are ≤ nm different scaled patterns representing all the occurrences of P.

  23. Proof: Each one has at most m possible matrices representing it mm, (m+1)(m+1), … , nn n-m different possible sizes

  24. Proof: Each one has at most m possible matrices representing it Why?

  25. Distance = 1

  26. … … … … … … … … (k-½)×(k -½) (k+½)×(k +½) … … … Pattern P scaled to size k×k,

  27. 1

  28. Therefore There are ≤ nm different scaled patterns representing all the occurrences of P.

  29. Algorithm outline for 2-D scaled matching

  30. Straightforward Idea • Construct dictionary of O(nm) possible scaled occurrences of P. • Use 2-dimensional dictionary matching algorithm to scan the text in linear time and find all occurrences.

  31. Space and Time Analysis Each one has at most m possible matrices representing it mm, (m+1)(m+1), … , nn Dictionary size O(n3m)

  32. Solution • Our idea is to keep the dictionary in compressed form. • The compression we use is run-length of the rows.

  33. Run-length aabcccbb a2b1c3b2

  34. The compressed dictionary Scaled To 2⅓

  35. # of repetitions of row Compressed form

  36. # of repetitions of row Size of Array: mxm # of diff. scaled patterns: (n-m) x m Dictionary size: O(nm3)

  37. The Idea behind the text searching • For every text location [i,j], we assume that there is a pattern scaled occurrence beginning at that location. • Subsequently, we establish the number of times this row repeats in the text. • This allows us to an appropriately scaled pattern row from the dictionary.

  38. T: 1 a10 b c150 … a10 b c150 … 2 . . . . . . . . . . . . . . . P: 1 a b c100 a b c100 2 a10 b c150 … 132 . . . . . . . . . . . . b10 c d150 … 133 . . . . . . . . . . . . . . . 102 a b c100 Example for text searching

  39. 1 a10 b c150 … aaaaaaaaaa

  40. T: 1 a10 b c150 … a10 b c150 … 2 . . . . . . . . . . . . . . . P: 1 a b c100 a b c100 2 a10 b c150 … 132 . . . . . . . . . . . . b10 c d150 … 133 . . . . . . . . . . . . . . . 102 a b c100 Look in the text location [1,10]

  41. T: 1 a10 b c150 … a10 b c150 … 2 . . . . . . . . . . . . . . . P: 1 a b c100 a b c100 2 a10 b c150 … 132 . . . . . . . . . . . . b10 c d150 … 133 . . . . . . . . . . . . . . . 102 a b c100

  42. 1 a10 b c150 …

  43. 1 a10 b c150 … aaaaaaaaaab

  44. 1 a10 b c150 … Look in the text location [1,10] aaaaaaaaaabccccccccccccccc…

  45. 22 2½2½ T: 1 a10 b c150 … a10 b c150 … 2 . . . . . . . . . . . . . . . P: 1 a b c100 a b c100 2 a10 b c150 … 132 . . . . . . . . . . . . b10 c d150 … 133 . . . . . . . . . . . . . . . 102 a b c100

  46. T: 1 a10 b c150 … a10 b c150 … 2 . . . . . . . . . . . . . . . P: 1 a b c100 a b c100 2 a10 b c150 … 132 . . . . . . . . . . . . b10 c d150 … 133 . . . . . . . . . . . . . . . 102 a b c100 A scale range of [1,1¼)

More Related