Jump to content

Jump flooding algorithm

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by The Anome (talk | contribs) at 09:08, 7 September 2021 (Uses: point-cloud rendering). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The jump flooding algorithm (JFA) is a flooding algorithm used in the construction of Voronoi diagrams and distance transforms. The JFA was introduced at an ACM symposium in 2006.[1]

The JFA has desirable attributes in GPU computation, notably constant-time performance. However, it does not always compute the correct result for every pixel, although in practice errors are few and the magnitude of errors is generally small.[1]

Implementation

The JFA original formulation is simple to implement.

Take an grid[2] (like an image or texture). All pixels will start with an "undefined" color unless it is a uniquely-colored "seed" pixel. As the JFA progresses, each undefined pixel will be filled with a color corresponding to that of a seed pixel.

For each step size , run one iteration of the JFA:

Iterate over every pixel at .
For each neighbor at where :
if is undefined and is colored, change 's color to 's
if is colored and is colored, if where and are the seed pixels for and , respectively, then change 's color to 's.

Note that pixels may change color more than once in each step, and that the JFA does not specify a method for resolving cases where distances are equal, therefore the last-checked pixel's color is used above.

The JFA finishes after evaluating the last pixel in the last step size. Regardless of the content of the initial data, the innermost loop runs a total of times over each pixel, for an overall computational complexity of

Uses

The jump flooding algorithm and its variants may be used for calculating Voronoi maps[1][3] generating distance fields,[4][how?] point-cloud rendering,[5] feature matching,[6] the computation of power diagrams,[7] and soft shadow rendering.[8] The grand strategy game developer Paradox Interactive uses the JFA to render borders between countries and provinces.[9]

Further developments

The JFA has inspired the developement of numerous similar algorithms. Some have well-defined error properties which make them useful for scientific computing.[10]

References

  1. ^ a b c Rong, Guodong; Tan, Tiow-Seng (2006-03-14). "Jump flooding in GPU with applications to Voronoi diagram and distance transform" (PDF). Proceedings of the 2006 Symposium on Interactive 3D Graphics and Games. I3D '06. Redwood City, California: Association for Computing Machinery: 109–116. doi:10.1145/1111411.1111431. ISBN 978-1-59593-295-2. S2CID 7282879.
  2. ^ The original paper uses the optimal case, a square grid, as an example, but a grid of any size works. Albeit with reduced efficiency. See this StackOverflow question for more.
  3. ^ Rong, Guodong; Tan, Tiow-Seng (July 2007). "Variants of Jump Flooding Algorithm for Computing Discrete Voronoi Diagrams". 4th International Symposium on Voronoi Diagrams in Science and Engineering (ISVD 2007): 176–181. doi:10.1109/ISVD.2007.41. ISBN 978-0-7695-2869-4. S2CID 386735.
  4. ^ Golus, Ben (2021-04-01). "The Quest for Very Wide Outlines". Medium. Retrieved 2021-08-19.
  5. ^ Farias, Renato (2014). "POINT CLOUD RENDERING USING JUMP FLOODING" (PDF).{{cite web}}: CS1 maint: url-status (link)
  6. ^ Yu, Pei; Yang, Xiaokang; Chen, Li (2012). Zhang, Wenjun; Yang, Xiaokang; Xu, Zhixiang; An, Ping; Liu, Qizhen; Lu, Yue (eds.). "Parallel-Friendly Patch Match Based on Jump Flooding". Advances on Digital Television and Wireless Multimedia Communications. Communications in Computer and Information Science. 331. Berlin, Heidelberg: Springer: 15–21. doi:10.1007/978-3-642-34595-1_3. ISBN 978-3-642-34595-1.
  7. ^ Zheng, Liping (2019-05-01). "GPU-based efficient computation of power diagram". Computers & Graphics. 80: 29–36. doi:10.1016/j.cag.2019.03.011. ISSN 0097-8493.
  8. ^ Rong, Guodong; Tan, Tiow-Seng (2006-11-01). "Utilizing jump flooding in image-based soft shadows". Proceedings of the ACM Symposium on Virtual Reality Software and Technology. VRST '06. Limassol, Cyprus: Association for Computing Machinery: 173–180. doi:10.1145/1180495.1180531. ISBN 978-1-59593-321-8. S2CID 15339123.
  9. ^ Boczula, Bartosz; Eriksson, Daniel (2020). "Optimized Gradient Border Rendering in Imperator: Rome". Intel. Retrieved 2021-03-28.{{cite web}}: CS1 maint: url-status (link)
  10. ^ Schneider, Jens; Kraus, Martin; Westermann, Rüdiger (2010). Ranchordas, AlpeshKumar; Pereira, João Madeiras; Araújo, Hélder J.; Tavares, João Manuel R. S. (eds.). "GPU-Based Euclidean Distance Transforms and Their Application to Volume Rendering". Computer Vision, Imaging and Computer Graphics. Theory and Applications. Communications in Computer and Information Science. 68. Berlin, Heidelberg: Springer: 215–228. doi:10.1007/978-3-642-11840-1_16. ISBN 978-3-642-11840-1.

As of this edit, this article uses content from "Is Jump Flood Algorithm Separable?", authored by alan-wolfe, trichoplax at Stack Exchange, which is licensed in a way that permits reuse under the Creative Commons Attribution-ShareAlike 3.0 Unported License, but not under the GFDL. All relevant terms must be followed.