1 / 39

Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU

Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU. Thanh -Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan. Euclidean Distance. if  p  = ( p 1 ,  p 2 ,...,  p n ) and  q  = ( q 1 ,  q 2 ,...,  q n )

Download Presentation

Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU

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. Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan

  2. Euclidean Distance • if p = (p1, p2,..., pn) and  q = (q1, q2,..., qn) are two points in Euclidean n-space, then the distance from p to q, or from q to p is given by:

  3. Voronoi diagram • A set of points (called seeds, sites, or generators) is specified beforehand and for each seed there will be a corresponding region consisting of all points closer to that seed than to any other.

  4. Euclidean Distance Transform 100 100

  5. Exact Euclidean Distance Transform • Let Si,jbe the nearest site, among all sites in row j,of the pixel (i, j), and let Si = {Si,j| Si,j NULL, j = 0, 1, 2, . . . , n−1} be the collection of such closest sites for all pixels in column i. Note that Si,jisNULLwhen there is no site in row j. • Let Pi be the set of sites whose Voronoi regions intersect the pixels in column i. These sites are termed the proximate sites of column i.

  6. Fact 1 • Consider column i and let b(i1, j) and b′(i2, j) be two sites in row j. If |i1 − i| < |i2 − i|, then the Voronoi region of b′ cannot intersect column i. • This fact means that for each column i, there can be at most one site along a row that can potentially be a proximate site, or basically, Pi ⊆ Si. As a result, |Pi| ≤ n.

  7. Fact 2 • Consider columni and let a(i1, j1), b(i2, j2), c(i3, j3) be any three sites with j1 < j2 < j3. Let the intersection of the perpendicular bisector of a and b and column i be p(i, u), and that of b and c be q(i, v). If u > v then the Voronoi region of b cannot intersect column i. • When the mentioned situation happens, we say that a and cdominateb on column i. In this case, bPi.

  8. Fact 3 • Let q(i, v) and p(i, u) be two pixels in column i such that u > v, and let a(i1, j1) and c(i3, j3) be the closest sites to q and p respectively. Then we have j1 ≤ j3. • This fact means that the proximate sites of column ihave their Voronoi regions appear in exactly the same order as when they are sorted by their y-coordinates.

  9. Exact Euclidean Distance Transform • Phase 1: For each pixel (i, j), compute Si,j. • Phase 2: Compute the set Pi for each column i using Si. • Phase 3: Compute the closest site for each pixel (i, j) using Pi

  10. Parallel Banding Algorithm Phase 1 - Band Sweeping Band 1 Band 2 Band 3 Band 4

  11. Parallel Banding Algorithm si i Phase 1 - Band Sweeping Band 1 Band 2 Band 3 Band 4 si,j si,j (i,j)

  12. Parallel Banding Algorithm Phase 1 - Band Sweeping Band 1 Band 2 Band 3 Band 4

  13. Parallel Banding Algorithm Phase 1 - Band Sweeping Band 1 Band 2 Band 3 Band 4

  14. Parallel Banding Algorithm Phase 1 - Band Sweeping Band 1 Band 2 Band 3 Band 4

  15. Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 Band 2 Band 3 Band 4

  16. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Band 1

  17. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Band 1 Si,2 Si,1 stack

  18. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 (i,v) Si,3 Band 1 v  u Si,2 Si,1 (i,u) stack

  19. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 (i,v) Band 1 Si,3 Si,2 Si,1 (i,u) stack

  20. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i (i,u) Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,4 Band 1 v u Si,5 Si,6 Si,3 Si,7 Si,2 Si,1 (i,v) stack

  21. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si (i,v) i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,4 Band 1 (i,u) v  u Si,2 Si,1 stack

  22. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si (i,v) i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,4 (i,u) Band 1 v  u Si,2 Si,1 stack

  23. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 (i,v) Si,5 Band 1 (i,u) v  u Si,4 Si,2 Si,1 stack

  24. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,6 Band 1 Si,5 Si,4 Si,7 Si,2 Si,1 stack

  25. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i (i,u) Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,7 Band 1 v u Si,6 Si,5 Si,4 Si,2 Si,1 stack (i,v)

  26. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 (i,u) Si,7 Band 1 v u Si,5 Si,4 (i,v) Si,2 Si,1 stack

  27. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i (i,v) Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Si,7 Band 1 v  u (i,u) Si,4 Si,2 Si,1 stack

  28. Parallel Banding Algorithm • Phase 2 - Hierarchical Merging si i Si,1 Si,2 Si,3 Si,4 Si,5 Si,6 Si,7 Band 1 Si,7 Si,4 Si,2 Si,1 stack

  29. Parallel Banding Algorithm i • Phase 2 - Hierarchical Merging Si,7 Si,4 Band 1 Si,2 Si,1 stack i Si,8 Si,9 Band 2 Si,12 Si,13

  30. Parallel Banding Algorithm i • Phase 2 - Hierarchical Merging Band 1 Si,7 Band 2 Si,8 Si,4 Si,9 Si,2 Si,1 Si,12 Si,13 stack

  31. Parallel Banding Algorithm i • Phase 2 - Hierarchical Merging Band 1 Si,12 Si,13 Si,9 Si,8 Si,7 Band 2 Si,4 Si,2 Si,1 stack

  32. Parallel Banding Algorithm Phase 2 - Hierarchical Merging i proximate texture Band 1

  33. Parallel Banding Algorithm Phase 3 - Block Coloring Case 1 pi i a a b m3 b

  34. Parallel Banding Algorithm Phase 3 - Block Coloring Case 2 pi i a a b m3 b

  35. Parallel Banding Algorithm Phase 3 - Block Coloring Case 2 pi i a a b m3 a a b b b

  36. Parallel Banding Algorithm

  37. Parallel Banding Algorithm

  38. Parallel Banding Algorithm

  39. Parallel Banding Algorithm

More Related