MORPHOLOGICAL OPERATORS INEL 6088 - M. Toledo Ref: Sec. 2.6, 2.7 - - PowerPoint PPT Presentation

morphological operators
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

MORPHOLOGICAL OPERATORS

INEL 6088 - M. Toledo

Ref: Sec. 2.6, 2.7 Jain et. al, Ch. 8 Davies

slide-2
SLIDE 2

MORPHOLOGICAL OPERATORS

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)

slide-3
SLIDE 3

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.

  • rigin

Original image A (left) and structuring element S (right). The origin of the structuring element is darker than other pixels in B

slide-4
SLIDE 4

Dilation: A⊕S=∪b∈S Ab

Alternative description: the structuring element S is swept

  • ver the image; each time the
  • rigin of the structuring element

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

  • location. When several shifts are prescribed by the mask S, the resulting shifted images are

combined by a set of union operations.

translation of A by b

slide-5
SLIDE 5

Dilation of A by B. Original figure A shown as a bold line.

slide-6
SLIDE 6

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Identity operation Left shift Horizontal thickening Isotropic thickening Symmetrical Horizontal thickening Examples of dilation masks and their effect

slide-7
SLIDE 7

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.

EROSION: A⊖S = ∩B∈S A-B

Original image’s boundary

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.

slide-8
SLIDE 8

OTHER STRUCTURING ELEMENTS

(taken from “Computer Vision” by Shapiro and Stockman)

slide-9
SLIDE 9

Geometric complement: reflection = binary image Br which is symmetric with B about the origin; Geometric duality of dilation and erosion: Logical duality (de Morgan)

(A ⊕ B)C = AC⊖Br (A ⊖ B)C = AC ⊕ Br Br = {-p | p ∈ B} (A ∪ B)C = AC ∩ BC (A ∩ B)C = AC ∪ BC

slide-10
SLIDE 10

Previous result

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.

slide-11
SLIDE 11

Dual of erosion: dilation of A’s background with B’s reflection

slide-12
SLIDE 12

(A ⊕ B) ⊕ C = A ⊕ (B ⊕ C) dilations are associatives (A ⊖ B) ⊖ C = A ⊖ (B ⊕ C) erosions are not assoc. X ⊕ Y = Y ⊕ X X ⊖ Y = Y ⊖ X boundary = A - (A ⊖ B)

slide-13
SLIDE 13

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.

slide-14
SLIDE 14

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

  • perations.

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

  • f a twiglet and how it is eliminated from consideration and/or identified.

JBjBl

" • * 1

  • ,
  • #

*

  • ^
  • J ^

(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

  • perations is a "closing" operation. In this case, closing is useful for eliminating the small holes in the
  • bjects. This would, for example, be useful for helping to prevent misleading loops from appearing in
  • skeletons. For this picture, extremely large window operations would be required to group peppercorns

into regions.

slide-15
SLIDE 15
slide-16
SLIDE 16

From Sternberg, S.R. 1985 “An Overview of Image Algebra using Mathematical Morphology” Integrated Technology for Parallel Image Processing Academic Press, London, 79-100

slide-17
SLIDE 17

Structuring elements used by Sternberg:

  • hole_ring: a ring of pixels whose diameter is slightly larger than the diameters
  • f the 4 holes in the watch gears. It fits just around these holes and can be used

to mark their centers.

  • hole_mask: an octagon slightly larger than the holes
  • gear_body: a disk structuring element that is as big as the gear minus its teeth
  • sampling_ring_spacer: a disk s.e. that is used to move slightly outward from the

gear body.

  • sampling_ring_width: disk s.e. used to dilate outward to the tips of the teeth
  • tip_spacing: a disk s.e. whose diameter spans the tip-to-tip space between

teeth.

Steps to produce figure 3.15(e):

  • open B3 with gear_body to get rid of the teeth
  • dilate with sampling_ring_spacer to bring it out of the base of the teeth
  • dilate that with sampling_ring_width to bring the image out to the tip of the tip
  • subtract the second from the last result to get a ring that just fit over the tip
slide-18
SLIDE 18

A ⌦ (B, C) = (A B) \ (AC C)

HIT AND MISS TRANSFORM

Can be used to search an image for instances of a shape (pattern matching)

erosion se 1 se 2 A’s background

slide-19
SLIDE 19

A B = max

b∈B Ab

A B = min

b∈B A−b

G = (A B) (A B)

GRAY

  • SCALE DILATION/

EROSION

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

G = morphological gradient. The

  • peration enhances the image edges.