Closed Liber-coder closed 3 years ago
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:
https://github.com/orzzzjq/Parallel-Banding-Algorithm-plus/blob/2f58720302c3478d4367b21268dfbb263b46c4d2/pba-plus-2D/pba/pba2D.h#L50-L60
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.
Hello, I'd like to enter a two-value image (this one in the middle of the image below) and generate its distance transform diagram (the one on the far right below), what do I need to do?