This figure illustrates the use of gray-scale open top-hat to compensate uneven illumination.
.
from morph import *
f=mmreadgray('rgrid_n.tif')
D=mmsedisk(10)
g=mmopen(f,D)
gth=mmopenth(f,D)
go=mmthreshad(gth,20)
Warning: Converting input image from int32 to uint8.
mmshow(f)
mmshow(g)
mmshow(gth)
mmshow(go)