MORPHOLOGICAL OPERATORS
INEL 6088 - M. Toledo
Ref: Sec. 2.6, 2.7 Jain et. al, Ch. 8 Davies
MORPHOLOGICAL OPERATORS INEL 6088 - M. Toledo Ref: Sec. 2.6, 2.7 - - PowerPoint PPT Presentation
MORPHOLOGICAL OPERATORS INEL 6088 - M. Toledo Ref: Sec. 2.6, 2.7 Jain et. al, Ch. 8 Davies MORPHOLOGICAL OPERATORS Intersection of A and B: binary image which is 1 at all pixels p which are 1 in both A and B Union of A and B: binary image which
Ref: Sec. 2.6, 2.7 Jain et. al, Ch. 8 Davies
The vector sum of pixels p and q with indeces (i,j) and (k,l) is the pixel p+q with indices (i+k,j+l). The vector difference p-q is the pixel with indices (i-k,j-l). The translation of a binary image A by pixel p is an image given by: Intersection of A and B: binary image which is 1 at all pixels p which are 1 in both A and B Union of A and B: binary image which is 1 at all pixels which are 1 in A or in B, or in both. Complement of A: Ω is a universal binary image (all 1’s)
BINARY IMAGE MORPHOLOGICAL OPERATIONS
Morphology refers to form or shape. Morphological operations use a binary image and a structuring element, which is another, much smaller, binary image.
Original image A (left) and structuring element S (right). The origin of the structuring element is darker than other pixels in B
Alternative description: the structuring element S is swept
is over a 1-pixel on the image, the entire structuring element is “Boolean OR-ed” to produce the output image. During a dilation operation, every pixel in the structuring element will be present in the final image if the structuring element origin is over a 1-pixel of the original image. Each 1 in S describes a shift of the image in the direction of the vector from the origin to the
combined by a set of union operations.
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Alternative description: The structuring element S is swept over the image. Each time the origin of S is over a 1-pixel on the image, the corresponding pixel in the resulting image is 1 only if all pixels in S are over 1-pixels in the original image.
Each 1 in S describes a shift of the image in the direction of the vector from the location to the origin. When several shifts are prescribed by the mask S, the resulting shifted images are combined by a set of intersection operations.
(taken from “Computer Vision” by Shapiro and Stockman)
Geometric complement: reflection = binary image Br which is symmetric with B about the origin; Geometric duality of dilation and erosion: Logical duality (de Morgan)
Complement of A and the reflection of B. The structuring element’s origin is still the darker pixel. Dual of dilation: eroding A’s background with the B’s reflection.
Dual of erosion: dilation of A’s background with B’s reflection
Opening: erosion followed by dilation with the same structuring element. Will remove all pixels in regions that are too small to contain S. A○B=(A⊖B)⊕B C l o s i n g : a d i l a t i o n followed by erosion. Can be used to suppress spatial features or discriminate against objects based upon their size. A⦁B=(A⊕B)⊖B Opening: erosion, shown on left, is followed by dilation. Final result shown at right. Closing: dilation, shown on left, is followed by erosion. Final result shown at right.
8.3 Mathematical Morphology 247
id) (e) Figure 8.3 Use of the opening operation, (a) shows a thresholded peppercorn image, (b) shows the result of applying a.1 xl erosion operation to the object shapes, and (c) shows the effect of subsequently applying a 7 x 7 dilation operation. The overall effect of the two operations is an "opening" operation. In this case, opening is useful for eliminating the twiglet. (d) and (e) show the same respective operations when appUed within an 11 x 11 window. Here some size filtering of the peppercorns has been achieved, and all the peppercorns have been separated—thereby helping with subsequent counting and labeling
246 CHAPTER 8 Mathematical Morphology and mask sizes is of vital importance in the design of complete algorithms for all these tasks. Figures 8.2 and 8.3 illustrate some of these possibilities in the case of a peppercorn image: some of the interest in this image relates to the presence
JBjBl
*
(a) ib) (c) id)
Figure 8.2 Use of the closing operation, {a) shows a peppercorn image, and {b) shows the result of thresholding, (c) shows the result of applying a 3 x 3 dilation operation to the object shapes, and {d) shows the effect of subsequently applying a 3 x 3 erosion operation. The overall effect of the two
into regions.
From Sternberg, S.R. 1985 “An Overview of Image Algebra using Mathematical Morphology” Integrated Technology for Parallel Image Processing Academic Press, London, 79-100
Structuring elements used by Sternberg:
to mark their centers.
gear body.
teeth.
Steps to produce figure 3.15(e):
A ⌦ (B, C) = (A B) \ (AC C)
A B = max
b∈B Ab
A B = min
b∈B A−b
G = (A B) (A B)
Dilation: select the largest grayscale value for all pixels under the mask B Erosion: select the smallest grayscale value for all pixel under mask B