Digital Image Processing Lecture Morphological Processing Recap &extend
Digital Image Processing Lecture Morphological Processing Recap &extend
It is typically applied to binary image, but there are versions that work on gray scale image.
Structuring Element
A structuring element is a matrix consisting of only 0's and 1's that can have any arbitrary shape and size. The pixels with values of 1 define the neighborhood .
Example: Neighborhood 0 0 0 0 0 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 0 1 1 1 0 0
0 0 0 1 0 0 0
Example of opening
Example of an Opening
Example of closing
Skeletonization
To reduce all objects in an image to lines, without changing the essential structure of the image
Morphological "top hat" operation returns the image minus the morphological opening of the image.
Example:
Input image
Result
Morphological "bottom hat" operation performs closing (dilation followed by erosion) and than subtracts the original image.
Example:
Input image
Digital Image Processing
Result
a dilation, an erosion of the input image by the same structuring element and than the subtraction of these two results.
One important application of the morphologic gradient on binary images is the boundary extraction. The same operator can be applied to gray level images.
Digital Image Processing
Input image
Dilation
Erosion
Subtraction
Original image
g = ( f b) ( f b)
Morphological Gradient
Digital Image Processing
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Hit-or-Miss operation
The hit-or-miss operation is a basic tool for shape detection. This operation requires two structuring elements. The neighborhoods of those structuring elements B1 andB2 should not have any overlapping elements. The hit-or-miss operation preserves pixels whose neighborhoods match the shape of structuring element B1 and don't match the shape of B2 hit-or-miss is defined as the intersection of the erosion of A by the first structure element and the erosion of the complement of A by the second structure element: HitOrMiss = Intersect (Erosion (A, SE1), Erosion (~A, SE2)).
Digital Image Processing
Input image
Result image
Structuring elements:
Morphological Reconstruction
Morphological reconstruction can be thought of conceptually as repeated dilations of an image, called the marker image, until the contour of the marker image fits under a second image, called the mask image. In morphological reconstruction, the peaks in the marker image "spread out,"
a)
b)
c)