Professional Documents
Culture Documents
18BCS6722
# Create an image and perform erosion using a Structuring Element with proper description.
0 0 0 0 0
0 1 1 1 0
0 1 1 1 0
0 1 1 1 0
0 0 0 0 0
SEGMENT A
1
1 1 1
1
SEGMENT B
Solution :
Origin of Segment B/structuring element is
1
1 1 1
1
Checking whether the structuring element is matching with the image pixel of segment A or not.
If it matches then the erosion of that particular pixel will be 1 else 0.
Erosion : A erosion B
Picking up structuring element from origin and putting it in each and every pixel of segment
A/image.
After doing it for each and every pixel we will get our output.
Output :
0 0 0 0 0
0 0 0 0 0
0 0 1 0 0
0 0 0 0 0
0 0 0 0 0
GUDDU KUMAR
18BCS6722
EROSION : is the counter-process of dilation. If dilation enlarges an image then erosion shrinks
the image. The way the image is shrunk is determined by the structuring element. The structuring
element is normally smaller than the image with a 3 x 3 size.
This will ensure faster computation time when compared to larger structuring-element size.
Almost similar to the dilation process, 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. Let us define X as the reference binary image and B as the
structuring element. Erosion is defined by the equation
X⊝B={z|(B^)Z∈X}
Equation states that the outcome element z is considered only when the structuring element is a
subset or equal to the binary image X. This process is depicted in Fig. b. Again, the white square
indicates O and the black square indicates 1.
The erosion process starts at position •. Here, there is no complete overlapping, and so the pixel
at the position • will remain white.
The structuring element is then shifted to the right and the same condition is observed. At
position u, complete overlapping is not present; thus, the black square marked with • • will be
turned to white.
The structuring element is then shifted further until its center reaches the position marked by •• •.
Here, we see that the overlapping is complete, that is, all the black squares in the structuring
element overlap with the black squares in the image.
Hence, the center of the structuring element corresponding to the image will be black. Figure b
shows the result after the structuring element has reached the last pixel. Erosion is a thinning
operator that shrinks an image. By applying erosion to an image, narrow regions can be
eliminated while wider ones are thinned.
Erosion is one of the two basic operators in the area of mathematical morphology, the other
being dilation. It is typically applied to binary images, but there are versions that work on
grayscale images. The basic effect of the operator on a binary image is to erode away the
boundaries of regions of foreground pixels (i.e. white pixels, typically). Thus areas of foreground
pixels shrink in size, and holes within those areas become larger.
How It Works
Useful background to this description is given in the mathematical morphology section of the
Glossary.
GUDDU KUMAR
18BCS6722
The erosion operator takes two pieces of data as inputs. The first is the image which is to be
eroded. The second is a (usually small) set of coordinate points known as a structuring element
(also known as a kernel). It is this structuring element that determines the precise effect of the
erosion on the input image.
connectedness). Such pixels must lie at the edges of white regions, and so the practical upshot is
that foreground regions shrink (and holes inside a region grow).
Erosion is the dual of dilation, i.e. eroding foreground pixels is equivalent to dilating the
background pixels.
The image
four times with a disk shaped structuring element 11 pixels in diameter. It shows that the hole in
the middle of the image increases in size as the border shrinks. Note that the shape of the region
has been quite well preserved due to the use of a disk shaped structuring element. In general,
erosion using a disk shaped structuring element will tend to round concave boundaries, but will
preserve the shape of convex boundaries.
Erosions can be made directional by using less symmetrical structuring elements. For example, a
structuring element that is 10 pixels wide and 1 pixel high will erode in a horizontal direction
only. Similarly, a 3×3 square structuring element with the origin in the middle of the top row
rather than the center, will erode the bottom of a region more severely than the top.
GUDDU KUMAR
18BCS6722
Grayscale erosion with a flat disk shaped structuring element will generally darken the image.
Bright regions surrounded by dark regions shrink in size, and dark regions surrounded by bright
regions grow in size. Small bright spots in images will disappear as they are eroded away down
to the surrounding intensity value, and small dark spots will become larger spots. most marked at