The scikit-image's filter.rank
module provides functions to implement morphological filters; for example, the morphological median filter and morphological contrast enhancement filter. The following sections demonstrate a couple of these filters.
The morphological contrast enhancement filter operates on each pixel by considering only the pixels in a neighborhood defined by a structuring element. It replaces the central pixel either by the local minimum or the local maximum pixel in the neighborhood, depending on which one the original pixel is closest to. The following code block shows a comparison of the output obtained using the morphological contrast enhancement filter and the exposure module's adaptive histogram equalization, with both the filters being local:
from skimage.filters.rank import enhance_contrast
def plot_gray_image(ax, image, title):
ax.imshow(image, vmin=0, vmax=255, cmap=pylab.cm.gray), ax.set_title...