Digital Image Processing & Computer Vision
Digital Image Processing & Computer Vision
Computer Vision
Digital Morphology
Chapter Content
DIGITAL MORPHOLOGY: Connectedness, Binary Operations, Dilation and Erosion, Opening and Closing,
Grey-Level Morphology, Color Morphology.
Morphology
Form and structure of an object (or) arrangement & interrelations between parts of an object
Digital Morphology
A way to describe or analyze the shape of a digital, most often raster object.
5
Morphology (An Example)
6
7
Digital Morphology
8
• Digital morphology uses the geometry of small connected sets of pixels to accomplish tasks that are
useful in processing regions within images.
9
Rasterization
10
Binary Pictures
Creation Processing
Connected Components
• Two pixels are connected if their squares share: Two connected All pixels
• A common edge pixels connected to x
• 4-connectivity
• A common vertex
x
• 8-connectivity
4-connectivity
8-connectivity
Connectivity (2D)
• Connected component
• A maximum set of pixels (voxels) in the object or background, such that any two pixels (voxels) are
connected via a path of connected pixels (voxels)
16
• Morphology can count and mark connected regions in images
• Can fill in small holes
• Can smooth boundaries
17
Elements of Digital Morphology - Binary Operations
18
Structuring Element
• A collection of non-linear processes which can be applied to an image to remove details smaller than a
certain reference shape
19
Morphological Image Processing
• Morphological operations are defined by moving a structuring element over the binary image to be
modified, in such a way that it is centered over every image pixel at some point. When the structuring
element is centered over a region of the image, a logical operation is performed on the pixels covered by
the structuring element, yielding a binary output.
20
• Like convolution kernel, the structuring element can be of any size, and it can contain complements of 1s and 0s.
• At each pixel position, a specified logical operation is performed between the structuring element and the underlying binary image.
• The binary result of that logical operation is stored in the output image at that pixel position.
• The effect created depends upon the size and content of the structuring element and the nature of the logical operation.
• Could be defined in 1, 2, 3 (or higher) dimensions.
If
structuring element is perfectly fit on to the binary image then perform the logical operation;
else
do not perform any operation into resultant binary image pixel
21
Set Operations
22
23
Logical Operations
24
Binary Dilation
• Translation
of the set A by the point x is defined in set notation as:
(A)x = {c | c = a + x, a Є A}
• Reflection of the set A is defined as :
= {c | c = -a, a Є A}
• Complement of the set:
• Intersection of the two sets A and B is the set of elements (pixels) belonging to both A and B:
• Union of the two sets A and B is the set of pixels that belong to either A or B or to both:
•• Dilation
is a process in which the binary image is expanded from its original shape.
• Expansion is determined by the structuring element.
• This structuring element is smaller in size compared to the image itself
• A Dilation of the set A by the set B is:
where
A represents the image being operated on,
B is a second set of pixels, a shape that operates on the pixels of A to produce the result.
26
• Fills in Holes
• Smoothens object boundaries
• Adds an extra outer ring of pixels onto object boundary,
27
• Using the input image and structuring element as given below, find the dilated version of the input
image.
28
29
Erosion
• Erosion is the counter-process of dilation. If dilation enlarges an image then erosion shrinks the image.
• The structuring element is normally smaller than the image with a 3 × 3 size.
• Faster computation time when compared to larger structuring-element size.
• The erosion process will move the structuring element from left to right and top to bottom.
• At the center position, indicated by the center of the structuring element, the process will look for whether there is a complete overlap with
the structuring element or not.
• If there is no complete overlapping then the center pixel indicated by the center of the structuring element will be set white or 0.
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Set Theory
47
48
49
50
Morphological Operators
Erosion Dilation
Morphological Operators
Erosion Dilation
Morphological Operators
Object (A)
Structure element (Bx)
A B
Closing
A B B