Computes polygonal skeletons from discrete data (i.e. images).
In complex use cases, this many magnitudes faster than purely polygonal approaches like CGAL's StraightSkeleton.
You can use this to quickly turn images of lines or graphs into a vector representation. It will not properly resolve circular graphs though. In rare cases, it fails to detect nodes of degree 3 or higher.
Achieves its speed by leveraging scipy.ndimage, scikit-image, numba, and using lookup tables and allocation-free data structures where possible.
The general approach implemented here (for detecting nodes and their connectivity) is described in:
Dirnberger, M., Kehl, T., & Neumann, A. (2015). NEFI:
Network Extraction From Images. Scientific reports, 5,
15669. https://doi.org/10.1038/srep15669
This implementation adds (1) exact tracing of connection paths once the nodes are discovered and (2) time (distance) information.
MIT