210 likes | 219 Views
This paper discusses the Parallel Banding Algorithm (PBA) for computing the Euclidean distance transform on GPU. It presents a three-phase approach that improves upon the naïve approach in terms of accuracy, parallelism, and expected total work. The paper includes experimental results comparing PBA with other algorithms, as well as limitations and future work.
E N D
Thanh-Tung Cao Ke Tang Anis Mohamed Tiow-Seng Tan
Outline • Distance transform and applications • Related works • Exact Euclidean distance transform • Parallel Banding Algorithm (PBA) • Experiment results i3D 2010 - Washington DC, USA
Distance Transform • Given a grid N = ndand a set of sites S, compute for every grid point the distance to the nearest site. n n Distance transform Voronoi diagram i3D 2010 - Washington DC, USA
Applications • Image processing, graphics, computational geometry... Morphological operation Integer medial axis Stipple drawing i3D 2010 - Washington DC, USA
Related Work • Approximate: Vector propagation approach • Danielsson [1980], O(n). • GPU based: • Jump flooding [Rong and Tan, 2006, 2007] • Schneider et al. [2009] • Exact: Voronoi diagram-based • Maurer et al. [2003], O(n), parallelizable. • PRAM: Lee et al [2003], Wang et al [2001] • GPU: PBA is the first. i3D 2010 - Washington DC, USA
Euclidean Distance Transform • Consider one column on the 2D image. Column i B' B Fact 1: Among all sites in the same column, only the nearest matter. i3D 2010 - Washington DC, USA
Euclidean Distance Transform • Consider one column on the 2D image. A Column i B C Fact 2: The Voronoi region of A and C can dominatethat of B. i3D 2010 - Washington DC, USA
Euclidean Distance Transform • Consider one column on the 2D image. A Column i C Fact 3: If A is on top of C then A’s region is also on top of C’s region. i3D 2010 - Washington DC, USA
Parallel Banding Algorithm Phase 1 Final result Phase 3 Phase 2 i3D 2010 - Washington DC, USA
The naïve approach • Phase 1: • Left – Right sweep, each pixel updates with the pixel on its left. • Right – Left sweep. i3D 2010 - Washington DC, USA
The naïve approach • Phase 2: Finding proximate points in linear time. • Process sites from top to bottom • Store the current set of proximate sites in a stack dominated i3D 2010 - Washington DC, USA
The naïve approach • Phase 3: • For a column, pixels are “colored” from top to bottom s1 p-1 s2 p p is nearer to s1 than to s2 Yes No p belongs to s1 s1 can be removed i3D 2010 - Washington DC, USA
Parallel Banding Algorithm • Motivations: • Within a row/column, the computation is sequential. • Maximum number of threads used is n (512, 1024, etc). • We needs 104 – 105 threads to fully utilize the latest GPUs. i3D 2010 - Washington DC, USA
Parallel Banding Algorithm • Phase 1: • A row is equally divided into m1 bands. • Within a band, perform the sweeping similar to the naïve approach. • Propagate the information among the first and the last pixel of different bands. • Pixels update with the first/last pixel of its band Updated! i3D 2010 - Washington DC, USA
Parallel Banding Algorithm • Phase 2: • A column is equally divided into m2 bands • For each band, we compute the proximate sites using the naïve approach. • Bands are merged hierarchically i3D 2010 - Washington DC, USA
Parallel Banding Algorithm • Phase 3: • Color a band of m3 pixels at a time, 1 thread per pixel. • Move to the next band when the last pixel of the current band confirms its color. s1 s2 confirmed s3 remove s1 i3D 2010 - Washington DC, USA
Experiment results • CUDA, nVidia GeForce GTX280 Naïve v.s. Banding approach i3D 2010 - Washington DC, USA
Experiment results Scalability Different bands for Phase 2 i3D 2010 - Washington DC, USA
Experiment results • Compare with JFA [Rong et al. 2006]and SKW [Schneider et al. 2009] 2D 3D i3D 2010 - Washington DC, USA
Conclusions • Advantages: • Accurate result → Algorithm to computing weighted centroidal Voronoi Diagrams on GPU (see paper) • Optimal linear expected total work • High level of parallelism, GPU friendly • Limitations: • Load balancing in Phase 2 • Worst case not work-optimal in Phase 3 i3D 2010 - Washington DC, USA
The paper, video, presentation slides and source code are available at: http://www.comp.nus.edu.sg/~tants/pba.html THANK YOU!