Morphology

Like spatial filters, morphological operations also work with pixel neighborhood. However, kernel coefficients do not multiply the neighborhood values. In mathematical morphology, the kernel is a structuring element. The two most basic operations are erosion and dilation also known as Minkowski subtraction and addition.

The operators are particularly useful for edge detection, noise removal and image enhancement.

 

Preestablished kernels: Basic kernels are available in the structuring element list (Square, Disk, Disk 2, Cross, Ring, Horizontal line, Vertical line).

However, it is possible to add new custom structuring elements to the list by pressing the New Element button. For removing a custom element, select the desired element and press the Delete button.

The Custom Structuring Element dialog allows to create common elements with two values (0 and 1) and grayscale structuring elements (integers from 0 to 255). Here zeros represent blank values which do not belong to the structuring element.

Kernel Size: Define the size of the kernel.

Kernel origin: X and Y position of the kernel origin (the position of the first cell is 0,0).

Note: The small green rectangle indicates the origin.

Apply Element: Apply the structuring element to the current image.

Add Element: Add the current element to the structuring element list (The element is set permanently to JMicroVision).

 

Erosion

This operation erodes bright regions on the image.

Dilation

This operation dilates bright regions on the image.

Opening

This operation (Erosion followed by Dilation) separates narrowly connected bright regions and removes small ones.

Closing

This operation (Dilation followed by Erosion) fills holes in bright regions and connects bright regions that are close.

Internal Gradient

This operation is an edge detector that extracts the internal contours of bright regions. The eroded image is subtracted from the original one.   

External Gradient

This operation is an edge detector that extracts the external contours of bright regions. The original image is subtracted from the dilated one.  

Black TopHat

This operation detects small dark regions. The closed image is subtracted from the original one.

White TopHat

This operation detects small bright regions. The opened image is subtracted from the original one.

 

See also:

Image Factory