Computes fast quasi-exact euclidean distance transforms in 2D/3D from a set of regions of interest.
Computing exact distance transforms is a common problem in image processing and computer vision.
This toolbox provides the generic framework for distance transform algorithms, and comes bundled with 2 fast quasi-exact approximation methods based on chamfer mask propagation (one is based on a 3x3x3 neighborhood mask, the other on a 5x5x5 neighborhood mask). These chamfer algorithms just need to sweep through the image data twice to compute the distance map, which makes them very fast and efficient, while yielding only minor errors compared to absolute Euclidean distance.
In addition, a third (more accurate) method has been implemented using Icy internal distance transform calculator. It is based on Saito’s article “New Algorithms for euclidean distance transformation of an n-dimensional digitized picture with applications” by Toyofumi Saito and Jun-Ichiro Toriwaki published in Pattern Recognition Vol. 27 No. 11, 1994. If you’re looking for measuring large distances between objects with high accuracy, then this is the method to use.
In the following images an example of each algorithm is presented to show their accuracy on a circular seed ROI. The images were created a modified LUT to make distance rings visible.
Adding new algorithms
The chamfer algorithms are very fast and efficient, although they may not be of sufficient precision in some very specific applications. You might also want to work with larger chamfer sizes that aren’t currently available. In both cases you are very welcome to implement your own algorithms and integrate them seemlessly with this one, simply by creating a new plug-in in which you extend the abstract class “DistanceTransform” with your own code. Once installed, this new plug-in will be automatically recognised and added it to the list of algorithms available in the graphical user interface (both in standalone and Protocols mode).