Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang...
-
Upload
aiden-rhead -
Category
Documents
-
view
223 -
download
0
Transcript of Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang...
![Page 1: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/1.jpg)
Parallel Banding Algorithm to Compute
Exact Distance Transform with the GPU
Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan
![Page 2: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/2.jpg)
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:
![Page 3: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/3.jpg)
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.
![Page 4: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/4.jpg)
Euclidean Distance Transform
100100
![Page 5: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/5.jpg)
Exact Euclidean Distance Transform
• Let Si,j be 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,j is NULL when 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.
![Page 6: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/6.jpg)
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.
![Page 7: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/7.jpg)
Fact 2• Consider column i 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 c dominate b on column i. In this case, b Pi.
![Page 8: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/8.jpg)
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 i have their Voronoi regions appear in exactly the same order as when they are sorted by their y-coordinates.
![Page 9: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/9.jpg)
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
![Page 10: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/10.jpg)
Parallel Banding AlgorithmPhase 1 - Band Sweeping
Band 1 Band 2 Band 3 Band 4
![Page 11: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/11.jpg)
Parallel Banding AlgorithmPhase 1 - Band Sweeping
Band 1 Band 2 Band 3 Band 4
(i,j)
si,j
sii
si,j
![Page 12: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/12.jpg)
Parallel Banding AlgorithmPhase 1 - Band Sweeping
Band 1 Band 2 Band 3 Band 4
![Page 13: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/13.jpg)
Parallel Banding AlgorithmPhase 1 - Band Sweeping
Band 1 Band 2 Band 3 Band 4
![Page 14: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/14.jpg)
Parallel Banding AlgorithmPhase 1 - Band Sweeping
Band 1 Band 2 Band 3 Band 4
![Page 15: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/15.jpg)
Parallel Banding AlgorithmPhase 2 - Hierarchical Merging
Band 1
Band 2
Band 3
Band 4
![Page 16: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/16.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
![Page 17: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/17.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
![Page 18: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/18.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,3
(i,v)
(i,u)
v u
![Page 19: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/19.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,3
(i,v)
(i,u)
![Page 20: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/20.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
(i,v)
(i,u)
v u
![Page 21: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/21.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
(i,v)
(i,u) v u
![Page 22: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/22.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
(i,v)
(i,u)v u
![Page 23: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/23.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,5
(i,v)
(i,u) v u
![Page 24: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/24.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,5
Si,6
Si,7
![Page 25: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/25.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,5
Si,6
Si,7
(i,v)
(i,u)
v u
![Page 26: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/26.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,5
Si,7
(i,v)
(i,u)
v u
![Page 27: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/27.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,7
(i,v)
(i,u)v u
![Page 28: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/28.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
iSi,1
Si,2
Si,3
Si,4
Si,5
Si,6
Si,7
si
stack
Si,1
Si,2
Si,4
Si,7
![Page 29: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/29.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
i
stack
Si,1
Si,2
Si,4
Si,7
Band 2
i
Si,8
Si,9
Si,12
Si,13
![Page 30: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/30.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
i
stack
Si,1
Si,2
Si,4
Si,7Band 2 Si,8
Si,9
Si,12
Si,13
![Page 31: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/31.jpg)
Parallel Banding Algorithm• Phase 2 - Hierarchical Merging
Band 1
i
stack
Si,1
Si,2
Si,4
Si,7Band 2
Si,8
Si,9
Si,12Si,13
![Page 32: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/32.jpg)
Parallel Banding Algorithm
Band 1
i
Phase 2 - Hierarchical Merging
proximate texture
![Page 33: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/33.jpg)
Parallel Banding AlgorithmPhase 3 - Block Coloring
Case 1
i
m3
pi
a
b
a
b
![Page 34: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/34.jpg)
Parallel Banding AlgorithmPhase 3 - Block Coloring
Case 2
i
m3
pi
a
b
a
b
![Page 35: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/35.jpg)
Parallel Banding AlgorithmPhase 3 - Block Coloring
Case 2
i
m3
pi
a
b
a
ba
b
a
b
![Page 36: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/36.jpg)
Parallel Banding Algorithm
![Page 37: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/37.jpg)
Parallel Banding Algorithm
![Page 38: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/38.jpg)
Parallel Banding Algorithm
![Page 39: Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.](https://reader036.fdocuments.net/reader036/viewer/2022062515/56649c745503460f94927396/html5/thumbnails/39.jpg)
Parallel Banding Algorithm