1. A computer-implemented method of processing a digital image at a selected scale level, the method comprising: calculating a gradient map for the digital image; calculating a density function for the gradient map; calculating a modified gradient map using the gradient map, the density function and the selected scale level; and segmenting the modified gradient map.