0% found this document useful (0 votes)
31 views14 pages

Matlab Report

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

Matlab Report

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

PROJECT REPORT OF VAC MATLAB

ON
EDGE DETECTION

DEPARTMENT OF ELECTRONICS AND


COMMUNICATION ENGINEERING

MODEL INSTITUTE OF ENGINEERING


AND
TECHNOLOGY [AUTONOMOUS], JAMMU

2022
CANDIDATES’ DECLARATION

We, Mehek(2020a3r007),Shriya Manhas(2020a3r009),


Mitali Abrol(2020a3r010), Rupali Sharma(2020a3r012),
Simran Choudhary(2020a3t016), hereby declare that the
work which is being presented in the VAC Matlab report
entitled, “Edge Detection ” in partial fulfillment of
requirement for the award of degree of B.E. (Electronics
and Communication) and submitted in the ECE Deptt.
of, Model Institute of Engineering and Technology
(Autonomous), Jammu is an authentic record of my own
work carried by us. The matter presented in this VAC
Matlab report has not been submitted in this or any other
University / Institute for the award of B.E. Degree.
ACKNOWLEDGEMENT

We have taken efforts in this project. However, it would


not have been possible without the kind support and help
of many individuals. We would like to extend our sincere
thanks to all of them. First and foremost, we would like
to thank Prof. Ankur Gupta (Director) Model Institute of
Engineering and Technology (MIET) Jammu, and Prof.
(Dr.) Ashok Kumar Dean (Academics) and Head of
Department.
As special gratitude we give to our mentor Mrs. Gurpreet
and Shiveta Mam whose contribution in stimulating
suggestions and encouragement which helped us to
writing this report. Lastly, we would like to thank our
respected parents who always encouraged us and taught
us to think and workout innovatively whatsoever be the
feel of life.

NAME ROLL NO.


Shriya Manhas 2020a3r009
Simran Choudhary 2020a3t016
Mehak 2020a3r007
Rupali Sharma 2020a3r012
Mitali Abrol 2020a3r010
CONTENT
Abstract
Introduction
Process
Code
Output
References
ABSTRACT

Edge detection is an image processing technique for


finding the boundaries of objects within images. It works
by detecting discontinuities in brightness. Edge detection
is used for image segmentation and data extraction in
areas such as image processing, computer vision, and
machine vision.

Common edge detection algorithms include Sobel,


Canny, Prewitt, Roberts, and fuzzy logic methods.
In an image, an edge is a curve that follows a path of
rapid change in image intensity. Edges are often
associated with the boundaries of objects in a scene.
Edge detection is used to identify the edges in an image.

For edge detection in this project, we take the help of


convolution: Convolution = I * m where I is the image,
m is the mask and * is convolutional operator. To
perform convolution on an image following steps are
required:
Flip the mask horizontally and then vertically. This will
result in 180-degree rotation of an image.
1. Slide the mask onto the image such that every pixel in
the image coincides with the center of the mask atleast
once.
2. Multiply the corresponding elements with the pixel
values below it and then add them.
3.Repeat this procedure until all pixel values of the image
have been calculated for updation.
INTRODUCTION:

Edge detection is an image processing technique for


finding the boundaries of objects within images. It
works by detecting discontinuities in brightness. Edge
detection is used for image segmentation and data
extraction in areas such as image processing, computer
vision, and machine vision.

Approach:
For edge detection, we take the help of convolution:
Convolution = I * m where I is the image, m is the
mask and * is convolutional operator. To perform
convolution on an image following steps are required:
1. Flip the mask horizontally and then vertically.
This will result in 180-degree rotation of an
image.
2. Slide the mask onto the image such that every
pixel in the image coincides with the centre of the
mask at least once.
3. Multiply the corresponding elements with the
pixel values below it and then add them.
4. Repeat this procedure until all pixel values of the
image have been calculated for updation.

Now, we will take 3×3 mask for the same.


3×3 Mask for vertical edges : [1, 0, -1; 1, 0, -1; 1, 0, -1]
3×3 Mask for horizontal edges : [1, 0, -1; 1, 0, -1; 1, 0, -
1]
3×3 Mask for principal diagonal edges : [1, 0, -1; 1, 0, -
1; 1, 0, -1]
3×3 Mask for secondary diagonal edges : [1, 0, -1; 1, 0,
-1; 1, 0, -1]
We’ll find these edges separately and finally combine t
hem using max function or mean function, but max fun
ction is more accurate for this.

THE CODE:

I=double(imread('image.jpg'));
In=I;
mask1=[1, 0, -1;1, 0, -1;1, 0, -1];
mask2=[1, 1, 1;0, 0, 0;-1, -1, -1];
mask3=[0, -1, -1;1, 0, -1;1, 1, 0];
mask4=[1, 1, 0;1, 0, -1;0, -1, -1];

mask1=flipud(mask1);
mask1=fliplr(mask1);
mask2=flipud(mask2);
mask2=fliplr(mask2);
mask3=flipud(mask3);
mask3=fliplr(mask3);
mask4=flipud(mask4);
mask4=fliplr(mask4);

for i=2:size(I, 1)-1


for j=2:size(I, 2)-1
neighbour_matrix1=mask1.*In(i-1:i+1, j-1:j+1);
avg_value1=sum(neighbour_matrix1(:));

neighbour_matrix2=mask2.*In(i-1:i+1, j-1:j+1);
avg_value2=sum(neighbour_matrix2(:));

neighbour_matrix3=mask3.*In(i-1:i+1, j-1:j+1);
avg_value3=sum(neighbour_matrix3(:));

neighbour_matrix4=mask4.*In(i-1:i+1, j-1:j+1);
avg_value4=sum(neighbour_matrix4(:));

%using max function for detection of final edges


I(i, j)=max([avg_value1, avg_value2, avg_value3,
avg_value4]);

end
end
figure, imshow(uint8(I))
Refrences:

1. MATLAB Programming for Engineers By Stephen


J.Chapman

2. Google

3. MATLAB & Simulink - MathWorks

4. Geeks For Geeks

5. Wikipedia

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy