0% found this document useful (0 votes)
39 views

Lab 9

The document discusses morphological operations like dilation, erosion, opening, and closing on different images using structuring elements of varying sizes. It performs dilation and erosion on blobs.png using a 7x7 structuring element. It then erodes blobs.png using 5x5 and 7x7 square structuring elements. Next, it closes circles.png and snowflakes.png using disk structuring elements of radius 10 and 5 pixels respectively. Finally, it opens blobs.png using disk structuring elements of radius 5 and 3 pixels.

Uploaded by

Lal Chand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

Lab 9

The document discusses morphological operations like dilation, erosion, opening, and closing on different images using structuring elements of varying sizes. It performs dilation and erosion on blobs.png using a 7x7 structuring element. It then erodes blobs.png using 5x5 and 7x7 square structuring elements. Next, it closes circles.png and snowflakes.png using disk structuring elements of radius 10 and 5 pixels respectively. Finally, it opens blobs.png using disk structuring elements of radius 5 and 3 pixels.

Uploaded by

Lal Chand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab 9

(Dilation)
clc;
clear all;
close all;
img=imread('blobs.png');
se=transpose([1 1 1 1 1 1 1]);
img1=imdilate(img,se);
subplot(1,2,1),imshow(img),title('original image');
subplot(1,2,2),imshow(img1),title('Dilated image');

(Erode)

img=imread('blobs.png');
se=transpose([1 1 1 1 1 1 1]);
img1=imerode(img,se);
subplot(1,2,1),imshow(img),title('original
image');subplot(1,2,2),imshow(img1),title('Erode
image')

Size if structuring elements:

a=imread('blobs.png');
w1=strel('square',5);
w2=strel('square',7);
b=imerode(a,w1);
c=imerode(a,w2);
subplot(2,2,1); imshow(a);
title('Original Image');
subplot(2,2,2); imshow(b);
title('Erode image with 5*5');
subplot(2,2,3); imshow(c);
title('Erode image with 7*7');
(Closing at 10):

img=imread('circles.png');
w1=strel('disk',10);
img1=imclose(img,w1);
subplot(2,2,1),imshow(img),title('original image');
subplot(2,2,2),imshow(img1),title('close image'):

(Closing at 5):

img=imread('snowflakes.png');
w1=strel('disk',5);
img1=imclose(img,w1);
subplot(1,2,1),imshow(img),title('original image');
subplot(1,2,2),imshow(img1),title('open image');

For blobs;

In open at 5
img=imread('blobs.png');
w1=strel('disk',5);
img1=imopen(img,w1);
subplot(2,1,1),imshow(img),title('original image');
subplot(2,1,2),imshow(img1),title('close image');

In Open at 3:
img=imread('blobs.png');
w1=strel('disk',3);
img1=imopen(img,w1);
subplot(2,1,1),imshow(img),title('original image');
subplot(2,1,2),imshow(img1),title('open image');
Size if structuring elements:

(Closing at 10):
(Closing at 5):

For blobs:
In open at 5
In Open at 3:

You might also like