Professional Documents
Culture Documents
Expt 5-To Perform Edge Detection Using Various Masksssp
Expt 5-To Perform Edge Detection Using Various Masksssp
Expt 5-To Perform Edge Detection Using Various Masksssp
EXPERIMENT NO.5
Date of Performance
Date of Checking
Digital Image and Video Processing Lab BE E&TC (2015 course) Sem-I
Dr. D. Y. Patil Group of Institutions’ Technical Campus
Dr. D. Y. PATIL SCHOOL OF ENGINEERING
Dr. D. Y. Patil Knowledge City, Charholi Bk., Via. Lohegaon, Pune – 412 105.
Department of Electronics and Telecommunication Engineering
Software: SCILAB
Theory:
Edge detection
Edge points are found where the image intensity encounters a steep variation along a
specific direction ‘x’ (Fig.1). This intensity variation can be detected and quantified by
finding the local maxima of the first order derivative of the image intensity (the gradient:
f=f’) or by finding the zero crossings of the second order derivative of the image intensity
(the laplacian: 2f=f”).
Fig.1 Detection methods of the edge points (points were the image intensity suffers a steep
variation).
( ) ( )
( ) [ ] [ ]
( ) ( )
Other approximations of the two components of the gradient can be computed through the
convolution of the image with the following kernels:
Digital Image and Video Processing Lab BE E&TC (2015 course) Sem-I
Dr. D. Y. Patil Group of Institutions’ Technical Campus
Dr. D. Y. PATIL SCHOOL OF ENGINEERING
Dr. D. Y. Patil Knowledge City, Charholi Bk., Via. Lohegaon, Pune – 412 105.
Department of Electronics and Telecommunication Engineering
Prewitt:
( ) [ ]
( ) [ ]
Sobel:
( ) [ ]
( ) [ ]
Roberts:
( ) [ ]
( ) [ ]
( ) √( ) ( ) )
( )
Digital Image and Video Processing Lab BE E&TC (2015 course) Sem-I
Dr. D. Y. Patil Group of Institutions’ Technical Campus
Dr. D. Y. PATIL SCHOOL OF ENGINEERING
Dr. D. Y. Patil Knowledge City, Charholi Bk., Via. Lohegaon, Pune – 412 105.
Department of Electronics and Telecommunication Engineering
Algorithm:
1) Start
2) Read the gray scale image i(x,y)
3) Obtain the size of the image (MXN).
4) Select an operator (Sobel, Prewitt or Robert) to perform edge detection.
5) Obtain the mask for corresponding operator (Sx and Sy).Select and store the size of
the mask in two variables.
6) Plot the original image and plot edge extraction image inbuilt function.
7) Initialize 4 nested for loops to2 outer for loops with respect to size of the image and
inner for loops with respect to masks. (Sx and Sy) size.
8) Convolve original image with Sx mask to get the X- gradient image.
9) Convolve original image with Sy mask to get the Y- gradient image.
10)Perform the following operation to get the resultant gradient.
√( ) ( )
11)Assign the value of S to the resultant image.
12)Display the edge detected image.
13)To see highlighted edge, keep the values of gray level having intensity 255 and
neglect others.
14)End.
Conclusion:
Digital Image and Video Processing Lab BE E&TC (2015 course) Sem-I