Distance Transform 'Hello World' and time complexity comparison

The proliferation of pictorial structures in vision got a major boost by P. Felzenszwalb's linear-time algorithm for computing euclidean-distance transforms. This transformation, when applied to detection, spreads high scores to nearby locations, taking into account the distance from the peak.

To see the difference this O(n) algorithm makes in practice compared to a naive implementation run the attached matlab script.

As a friend Paul Sturgess said: "this is the difference between fast and scalable!!"