# Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan.

## Presentation on theme: "Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan."— Presentation transcript:

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 ) are two points in Euclidean n -space, then the distance from p to q, or from q to p is given by:Euclidean n -space

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.

Euclidean Distance Transform 100

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

Fact 1 Consider column i and let b ( i 1, j ) and b ′( i 2, j ) be two sites in row j. If | i 1 − i | < | i 2 − 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, P i ⊆ S i. As a result, | P i | ≤ n.

Fact 2 Consider column i and let a ( i 1, j 1 ), b ( i 2, j 2 ), c ( i 3, j 3 ) be any three sites with j 1 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  P i.

Fact 3 Let q ( i, v ) and p ( i, u ) be two pixels in column i such that u > v, and let a ( i 1, j 1 ) and c ( i 3, j 3 ) be the closest sites to q and p respectively. Then we have j 1 ≤ j 3. 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.

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

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

Parallel Banding Algorithm Phase 1 - Band Sweeping Band 1Band 2Band 3Band 4 ( i,j ) s i,j sisi i

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

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

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

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

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,3 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,3 ( i,v ) ( i,u )

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,5 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,5 S i,6 S i,7

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,5 S i,6 S i,7 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,5 S i,7 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,7 ( i,v ) ( i,u ) v  u

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i S i,1 S i,2 S i,3 S i,4 S i,5 S i,6 S i,7 sisi stack S i,1 S i,2 S i,4 S i,7

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i stack S i,1 S i,2 S i,4 S i,7 Band 2 i S i,8 S i,9 S i,12 S i,13

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i stack S i,1 S i,2 S i,4 S i,7 Band 2 S i,8 S i,9 S i,12 S i,13

Parallel Banding Algorithm Phase 2 - Hierarchical Merging Band 1 i stack S i,1 S i,2 S i,4 S i,7 Band 2 S i,8 S i,9 S i,12 S i,13

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

Parallel Banding Algorithm Phase 3 - Block Coloring Case 1 i m3m3 pipi a b a b

Parallel Banding Algorithm Phase 3 - Block Coloring Case 2 i m3m3 pipi a b a b

Parallel Banding Algorithm Phase 3 - Block Coloring Case 2 i m3m3 pipi a b a b a b a b

Parallel Banding Algorithm

Download ppt "Parallel Banding Algorithm to Compute Exact Distance Transform with the GPU Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan."

Similar presentations