Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Edge Detection - Digital Signal Processing - Lab Handouts, Lecture notes of Digital Signal Processing

Main points of this handout are: Edge Detection, Gradient Based Techniques, Performance Evaluation of Techniques, Matlab Code, Performance Measures, Sobel Operators, Number of Edge Pixels, Detection Technique, Gradient Operators

Typology: Lecture notes

2012/2013

Uploaded on 05/18/2013

maazi
maazi 🇮🇳

4.4

(12)

77 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE-S490 Digital Image Processing
Laboratory 3
Edge Detection
1 Introduction
In this experiment, you will determine the edge maps of noise free and noisy images using
different gradient based edge detection techniques and compare their performances. In the first
part you will obtain the edge maps of noise free images using different Gradient based
techniques i.e. Roberts, Prewitt and Sobel operators for different thresholds. In the second part
you will compare the performances of Gradient based edge detectors for noisy images of different
SNRs.
2 Gradient based techniques
In this problem, you will analyze and implement different types of Gradient based edge detection
techniques for different thresholds. Remember that the gradient of the original image I(m,n) in two
orthogonal directions are obtained using a pair of masks h1(m,n) and h2(m,n).
g1(m,n)=h1(m,n)*I(m,n) g2(m,n)=h2(m,n)*I(m,n)
then the magnitude of the gradient is approximated as:
g(m,n)=|g1(m,n)|+|g2(m,n)|
Different approximations of the gradient operation together with the smoothing operation produce
different pairs of masks. Essentially, it is those pair of masks that characterize the different
gradient operators. The masks for Roberts, Prewitt and Sobel operators are given below:
Edge map ε(m,n) is obtained using the gradient g(m,n) as:
ε(m,n)=1 for g(m,n)>T
0 Otherwise
[ ] [ ]
[ ] [ ]
[ ] [ ]
121
000
121
101
202
101
Sobel
111
000
111
101
101
101
Prewitt
10
01
01
10
Roberts
n)(m,hn)(m,h
21
Docsity.com
pf3

Partial preview of the text

Download Edge Detection - Digital Signal Processing - Lab Handouts and more Lecture notes Digital Signal Processing in PDF only on Docsity!

ECE-S490 Digital Image Processing

Laboratory 3

Edge Detection

1 Introduction In this experiment, you will determine the edge maps of noise free and noisy images using different gradient based edge detection techniques and compare their performances. In the first part you will obtain the edge maps of noise free images using different Gradient based techniques i.e. Roberts, Prewitt and Sobel operators for different thresholds. In the second part you will compare the performances of Gradient based edge detectors for noisy images of different SNRs.

2 Gradient based techniques In this problem, you will analyze and implement different types of Gradient based edge detection techniques for different thresholds. Remember that the gradient of the original image I(m,n) in two orthogonal directions are obtained using a pair of masks h 1 (m,n) and h 2 (m,n). g 1 (m,n)=h 1 (m,n)I(m,n) g 2 (m,n)=h 2 (m,n)I(m,n) then the magnitude of the gradient is approximated as: g(m,n)=|g 1 (m,n)|+|g 2 (m,n)| Different approximations of the gradient operation together with the smoothing operation produce different pairs of masks. Essentially, it is those pair of masks that characterize the different gradient operators. The masks for Roberts, Prewitt and Sobel operators are given below:

Edge map ε(m,n) is obtained using the gradient g(m,n) as: ε(m,n)=1 for g(m,n)>T 0 Otherwise

[ ] [ ]

[ ] [ ]

[ ] [ ]

Sobel

Prewitt

Roberts

h 1 (m,n) h 2 (m,n)

Steps :

  1. Download the original image I(m,n)=imread(‘rice.tif’) from the web page.
  2. Write a Matlab function edgemap.m which will accept the original image, the thereshold percentage, α and the Gradient operators (Roberts, Prewitt or Sobel) as its inputs and produce the edge map ε(m,n) as its output. Just to give you an example: function [Iem]=edgemap(I,α,’Roberts’) In this function you will: a. first calculate the g(m,n) using the appropriate masks h 1 (m,n) and h 2 (m,n) depending on the chosen operator, b. then obtain the cumulative distribution function (cdf) of g(m,n) and select the threshold T that will produce %α of the pixels as edges. This can be thought as: Pr{g(m,n)>T}=%α c. finally obtain the edge map of the selected operator.
  3. Obtain the edge maps of the Roberts, Prewitt and Sobel operators for α =5 and 20.

Section 2 Report : Hand in:

  1. A print out of original image (rice.tif), edge maps after using Roberts, Prewitt and Sobel operators for α =5 on one page. (You can use subplot command in Matlab to plot more than one images on one page.)
  2. A print out of original image (rice.tif), edge maps after using Roberts, Prewitt and Sobel operators for α =20 on one page.
  3. Print out of your Matlab code.

3 Performance Evaluation of the techniques In this problem, you will evaluate the performance of different gradient based edge detection techniques. One of the methods of performance evaluation for edge detectors is to look at the detection rates at various noise levels. The detection rate can be defined by the rate of the number of edge pixels detected by a detection technique, nd and the total number of edge pixels, no which is known apriori: D=nd/no In the noiseless case all the operators are roughly equivalent. Here, we will test the performance of Roberts, Prewitt and Sobel operators for noisy images with SNR=20, 10, 5dB.