#udf #image-processing #computer-vision #distance-field

fast-sweeping

Unsigned Distance Fields using Fast Sweeping Method

1 unstable release

0.1.0 Jun 24, 2025

#655 in Images

EUPL-1.2

22KB
308 lines

Fast Sweeping UDF — Distance Fields using the Fast Sweeping Method

A test implementation of the Fast Sweeping Method for calculation of (unsigned) Distance Fields.

To run an example that outputs the distance field into PGM pictures test-distances.pgm and test-obstacles.pgm, run

cargo run --example write_pgm

This is the outcome. (For better visibility, the distance field shows the square root of the actual distances.)

Obstacles Distance Field (sqrt)

A naive Fast Sweeping implementation can be found in src/fast_sweeping.rs.

No runtime deps