Top hat transformation
• The top hat transformation is used as a simple tool for segmenting objects in gray-scale images that differ in brightness from background, even when the background is of uneven gray-scale. • The top hat transform is superseded by the watershed segmentation for more complicated backgrounds. • Assume a gray-level image X and a structuring element K. The residue of opening as compared to original image X ∖ (X ∘ K) constitutes a new useful operation called a Top hat transformation. • The top hat transformation is a good tool for extracting light objects on a dark but slowly changing background. Those parts of the image that cannot fit into structuring element K are removed by opening. • Subtracting the opened image from the original provides an image where removed objects stand out. • The actual segmentation can be performed by simple thresholding (Fig 18). • If an image were a hat, the transformation would extract only the top of it, provided that the structuring element is larger