Share

Program for Dilation, Erosion, Opening and Closing in Matlab

Program for Dilation, Erosion, Opening and Closing in Matlab. Here you will get complete coding for the above mention topic of Dilation, Erosion, Opening and Closing and their properties.

Below you will get learn how we can use Matlab Program for Dilation, Erosion, Opening and Closing and their properties.

What is Image Processing

Image Processing is a technique to perform some functions on an image, in order to have an improved image or to extract various interesting facts from it.

Image Morphology is an essential tool in image processing. It is actually the learn shapes of object present in the image and extraction of image features.

Image features are essential for object recognition. The basic morphological operations include Erosion and Dilation, Opening and Closing are also morphological operators. These operators are deciding on as basic operations in image processing algorithms.

DILATION

Dilation is used to binary and grey scale images.

Syntax
   Y = imdilate(A,B);
          • A = input image
          • B = Structuring element
          • Y = Dilated image

The main purpose of this Dilation is that:

  • Dilation adds pixels to the boundaries of objects in an image.
  • It expands the window and shrinks background.
  • It slowly increases the boundaries of the region
  • Small holes in the image become smaller.
  • It increases the illumination of the object

EROSION

Erosion is also very important operator like dilation. It shrinks/thin objects in a binary image.

Syntax
                   SE =imerode(A,B);

The significant purpose of erosion is to:

  • Erosion removes pixels on object boundaries
  • It Shrinks the window and grows background.
  • It used to make an object shorter by eliminating is outside region of pixels.
  • The image gets darker. After implementation of erosion.
  • Erosion takes image and structuring element as inputs and thins the subject.

OPENING

Opening operation is mixed of dilation and erosion operations. In Opening operation Erosion is followed by Dilation.­­

  • Opening Operation is similar to Erosion
  • In Opening Operation Spot and noise removal occurs
  • It is Less destructive
  • In this operation Erosion is followed by dilation

Input:

  • Binary Image
  • Structuring Element.

CLOSING

Closing operation is a dilation operation followed by an erosion operation. Closing is actually the group of points, which the intersection of object B about them with object A is not vacant.

  • It removes small holes.
  • It is idempotent.
  • It is increasing.
  • It is translation invariant.
  • Opening is idempotent: repeating application has no additional effects.

Write A Program for Dilation, Erosion, Opening, Closing and their Properties.

clc;
clear all;
close all;
a=imread(‘C:\Users\Allah\Pictures\sample_Images_for_matlab\images(5).jpg’);

% Read an input image

b=strel(‘line’,11,90);
% strel represents morphological structuring element
figure(1);
imshow(a);
title(‘Axon Original image’);

Program for Dilation
Output

c=imdilate(a,b);
figure(2);
imshow(c);
title(‘ Axon Dilate image’);

Program for Dilation
Dilate Image Output

Find: SBA Science Paper for Grade 5th with Answer Keys

d=strel(‘disk’,11);
e=imerode(a,d);
figure(3);
imshow(e);
title(‘ Axon Erode image’);

c=imopen(a,b);
figure(4);
imshow(c);
title(‘Axon Open image’);

d=strel(‘disk’,11);
e=imclose(a,d);
figure(5);
imshow(e);
title(‘Axon Close image’)

%Properties

h=[0 1 0;1 1 1;0 1 0];
i1=imdilate(a,h);
figure(6);
imshow(i1);
title(‘Axon Dilate image Pro 1’);

% pro=properties
i2=imerode(a,h);
figure(7);
imshow(i2);
title(‘Axon Erode image Pro 2 ‘);

i3=a-i2;
figure(8);
imshow(i3);
title(‘Axon Pro 3’);

Download : SBA Social Science Paper for Grade 5th with Answer Keys.

i4=i1-a;
figure(9);
imshow(i4);
title(‘Axon Pro 4’);

i5=i1-i2;
figure(10);
imshow(i5);
title(‘Axon Pro 5’);

All above data is refraining to the book ZERO-TO-HERO by ARSATH NATHEEM S Copyright © 2017, 2018 by futurebme.com.