0% found this document useful (0 votes)
73 views24 pages

DSP Project Example

This project document describes using a Sobel filter to perform edge detection on an image. It provides an introduction to edge detection and the Sobel operator. The steps of edge detection including smoothing, enhancement and thresholding are outlined. The Sobel algorithm is described along with sample MATLAB code to read an image, apply the Sobel filter, and output the edge detected image. Examples of edge detection on images of the human brain and heart are shown. Advantages and limitations of the Sobel filter are also summarized.

Uploaded by

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

DSP Project Example

This project document describes using a Sobel filter to perform edge detection on an image. It provides an introduction to edge detection and the Sobel operator. The steps of edge detection including smoothing, enhancement and thresholding are outlined. The Sobel algorithm is described along with sample MATLAB code to read an image, apply the Sobel filter, and output the edge detected image. Examples of edge detection on images of the human brain and heart are shown. Advantages and limitations of the Sobel filter are also summarized.

Uploaded by

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

DIGITAL SIGNAL

PROCESSING PROJECT
PROJECT TITLE:
EDGE DETECTION OF AN IMAGE USING
SOBEL FILTER

NAME: XXX
BRANCH: ETC
ID: YYY
Out line
 Introduction
 Edge Detection
 Steps for Edge detection
 Sobel Operator
 Algorithm
 MATLAB code
 Output
 Advantages
 Future Scope
 Limitations
Introduction:
An edge in an image
 is a significant local change in the image intensity
 usually associated with a discontinuity in the image
intensity,.
 Abrupt Change in pixels.
 Occurs at the boundary of two regions.
Edge Detection:
 The edges in an image can be used to resolve depth, size
orientation and surface properties of a digital image.
 It is the process of identifying edges of an image.
 One of the fundamental property in image analysis.
 Locates areas having strong contrast in intensity.
Why is Edge Detection
needed?
 Most of the information of an image is enclosed in its edges.
 It reduces the necessary data in image and preserves the
structure of the image.
 Extracts features like corners , lines and curves.
Steps of Edge Detection:
 Smoothing: Reduce the noise without destroying the edges

 Enhancement: Applying a filter or computing the gradient


magnitude to enhance the image(image sharpening).

 Detection: Retaining the edge points that are required to analyse


and discarding the other points as noise. Thresholding provides the
criterion used for detection.

 Localization: Estimation of the exact position of the edge with sub


pixel resolution if required for the application . It includes edge
thinning and linking.
Sobel Operator:
 Sobel operator is an approximation to derivative of an image. It
uses two 3x3 kernels which are convolved with the original
image.
 Let A be the source image, F1 and F2 be the sobel convolution
kernels, Gx and Gy are two images which at each point contain
the horizontal and vertical derivative approximations
respectively, the computations are as follows:
Horizontal Mask of Sobel Operator:

F1= -1 -2 -1

0 0 0

1 2 1
Vertical Mask of Sobel Operator:

F2 = -1 0 1

-2 0 2

-1 0 1

Gx = F1 * A and Gy = F2 * A
Where * denotes the 2-dimensional signal
processing convolution operation.
Working of Masks:
 Horizontal Mask:
o This mask will prominent the horizontal edges in an image.
o It calculates the difference of above and below pixel intensities
of the particular edge.
o Thus increasing the sudden change of intensities and making
the edge more visible.
Vertical Mask:
o When this mask is applied on the image the vertical edges
become prominent.
o It simply calculates the difference of pixel intensities in an
edge region.
o Also the center values of both the first and third column is 2 and -2
respectively.
o Masking increases the edge intensity and it become enhanced
comparatively to the original image.

IMAGE CONVOLUTION EXAMPLE:


Algorithm:
 Read the image
 Convert the image to grayscale and then to double
 Use the mask F1 for x direction and F2 for y direction and
obtain the gradient of the image.
 Find the magnitude of the vector.
 Threshold the image
 Display the logical image
MATLAB CODE:
clc
clear all
close all
%read image from file
X=imread('flower.png');
%display of image
figure(1);
imshow(X);
title('Original Image');
%conversion of image from grayscale to rgb
Y=rgb2gray(X);
%display of grayscale image
figure(2);
imshow(Y);
title('Grayscale Image');
MATLAB CODE(continued):
%Double precision done on images for easier calculation
Z=double(Y);
%Image Convolution/Sobel Filter
for i=1:size(Z,1)-2
for j=1:size(Z,2)-2
%Sobel mask for x-direction:
Gx=((2*Z(i+2,j+1)+Z(i+2,j)+Z(i+2,j+2))-(2*Z(i,j+1)+Z(i,j)+Z(i,j+2)));
%Sobel mask for y-direction:
Gy=((2*Z(i+1,j+2)+Z(i,j+2)+Z(i+2,j+1))-(2*Z(i+1,j)+Z(i,j)+Z(i+2,j)));
%The gradient of the image
Y(i,j)=sqrt(Gx.^2+Gy.^2);
end
end
MATLAB CODE(continued):

%display of gradient in X and Y direction respectively(Sobel Mask)


[Gx1,Gy1] = imgradientxy(Z);
figure(3);
imshowpair(Gx1,Gy1,'montage');
title('Gradients in X and Y Directions');

%display of sobel gradient


figure(4);
imshow(Y);
title('Sobel Gradient');
MATLAB CODE(continued):
%thresholding
Thresh=100;
Y=max(Y,Thresh);
Y(Y==round(Thresh))=0;
Y=uint8(Y);
%display of edge detected image
figure(5);
imshow(~Y);
title('Edge Detected Image');
OUTPU
T:

Original Image Grayscale Image

Gradients in X and Y Direction


OUTPUT:
Sobel Gradient

Edge Detected Image


FIGURE: Edge detection of Human brain image containing tumor
Figure: Lane detection
FIGURE: Edge detection Human heart image
Advantages of using Sobel
Filter:
1. Sobel masks perform better noise suppression than Prewitt operator.
2. Image smoothing can be done.
3. It is simple to implement.
4. It involves less time, hence quicker.
5. It executes same output every time, hence stable.

Limitatio
ns:
 Diagonal direction points are not preserved always.
 It is sensitive to noise (low signal to noise ratio).
Applications/Future Scope:
 Sobel filter is used for heavy data transfer in the form of
images and videos.
 The most important use of this filter is to identify or detect
any pathological objects in medical images such as brain
tumors.
 It can also be used in lane departure warning system to detect
edges of lanes.
 It is also used in self driving cars or in traffic management.
Conclusion:

In this project , edge detection of different images has been


done using sobel filter and its various applications has been
studied. It can be modified according to application in different
situations. In order to reduce the limitations of this filter , more
efficient algorithms can be used such as Canny Edge Detector,
Gaussian and Laplacian operators.
References:

[1] xxxx
[2] yyy
[3] zzz

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