How do I generate a distance transform diagram similar to the one in README.MD?
Closed this issue · 2 comments
Parallel-Banding-Algorithm-plus/pba-plus-2D/main.cpp
Lines 87 to 109 in 2f58720
First, modify this function and set the value of the front points (in the image, the white pixels) to be their coordinate (tx, ty)
. And leave the other points to be MARKER
. Then run the program you can get the Voronoi diagram. Some details can be found here:
Parallel-Banding-Algorithm-plus/pba-plus-2D/pba/pba2D.h
Lines 50 to 60 in 2f58720
After calling this function pba2DCompute()
, pbaTextures[1]
will store the coordinate of the closest front point, then you can write a simple kernel to compute the distance.
Thank you, I probably understand how to generate a dt diagram.