algorithmmatlabflood-fill

What do you call an iterated flood fill algorithm?


I have an algorithm that I'm using for my work, but I need a name for it. I am curious if name exists in the literature for an algorithm of this type.

The algorithm takes a pixelated height map and a starting point s, and returns a modified pixelated height map. For each pixel p in the returned height map, p is the value of lowest height you must pass through to get from s to p.

Example, consider the "peak" image in Matlab: imagesc(peak) Peak Image from Matlab.

And use the pixel (20,20) as the seed, then this modified height map I am describing looks like this: enter image description here.

I had called this a flood fill algorithm, until my colleagues pointed out that flood fills are typically binary maps. So, Ive taken to calling this a "graduated flood fill" algorithm.

We have not found this operation defined in the literature. Any suggestions?


Solution

  • In Matlab, this algorithm is called Morphological Reconstruction. The matlab command to implement the algorithm is called: imreconstruct.

    The specific steps are:

    tmp = peaks
    apt = zeros(size(tmp));
    apt(20,20) = tmp(20,20);
    imagesc(imreconstruct(apt, tmp))
    

    which generates this image, as requested.

    enter image description here