Uneven background subtraction: Rolling ball vs Disk tophat A classical technique in still images (e.g. fluorescence microscopy images) to remove uneven illumination and isolate bright blobs is to use morphological operation such as the top-hat transform.

For instance the Rolling-ball algorithm[1] uses a ball as a structuring element and performs the top-hat transform[2].

The structuring element is a grayscale element that extends the disk structuring element in 3D. For instance in MATLAB:

se2 = strel('ball', 3, 3);
     0    0.4999    0.9997    1.4996    0.9997    0.4999         0
0.4999    0.9997    1.4996    1.9995    1.4996    0.9997    0.4999
0.9997    1.4996    1.9995    2.4994    1.9995    1.4996    0.9997
1.4996    1.9995    2.4994    2.9992    2.4994    1.9995    1.4996
0.9997    1.4996    1.9995    2.4994    1.9995    1.4996    0.9997
0.4999    0.9997    1.4996    1.9995    1.4996    0.9997    0.4999
     0    0.4999    0.9997    1.4996    0.9997    0.4999         0




My question is: Is it so much better than simply using a binary disk as a structuring element? What are the use cases where a rolling ball is way better, or even required? 

My experiments with comparing the outputs of the two do not show a striking difference between the two, but the literature behind the Rolling ball is very abundant. 



[1] Stanley Sternberg, "Biomedical Image Processing", IEEE Computer, January 1983

[2] Here is the source code for a Java implementation in ImageJ: http://rsbweb.nih.gov/ij/plugins/download/Rolling_Ball_Background.java
I guess the basic question here becomes - what difference does non-flat structuring elements make w.r.t flat structuring elements ?

From the definition of dilation one can see that the structuring element can define a support (like in flat structuring elements) or another function itself (gray scale structuring elements). Look at wiki which defines the dilation operations. The grayscale or numerical version performs a Minkowski Sum. The dilation operation here basically looks for the max on the sum of the two functions. With grayscale dimension one is basically looking at the topographical features of the image level. Its called the rolling ball algorithm since it shaves off non smooth parts of the image which are less convex that the sphere structuring element one defines. The top hat is non flat and basically removes features in each level set and has no effect on the topographical height directly. It depends on the image and problem how these 2 operations are used. One can also write structuring elements to look for connected maximas or minimas(Jump connection), smooth regions(Smooth Connection) refer.