This is essentially the fractional change in the function value due to moving from x to y, and therefore d(x, y) ∈ [0, 1] independently of the scale of the function. Once d(x, y) has been defined, a tolerance t can be chosen such that d(x, y) < t defines a stationary region around each maxima (see Fig. ) and apply the following algorithm to cluster local maxima into families. The algorithm begins by constructing a flood fill around each local maxima according to the tolerance and ends by merging overlapping flood fills into connected families (see Fig. ):