0% found this document useful (0 votes)
17 views22 pages

Lect 33

Uploaded by

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

Lect 33

Uploaded by

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

Digital imag

e
processing
Lecture 33
Basic Edge Detection by Using First-Order
Derivative
 f 
 g x   x 
f  grad ( f )    
 g y   f 
 y 
The magnitude of f
M ( x, y ) mag(f )  g x 2  g y 2
The direction of f
 gx 
1
 ( x, y ) tan  
 g y 
The direction of the edge
01/20/25
  - 90 2
01/20/25 3
First derivative for edge
detection

01/20/25 4
01/20/25 5
01/20/25 6
01/20/25 7
01/20/25 8
01/20/25 9
01/20/25 10
01/20/25 11
Advanced edge detection
0 MARR – HILDRETH EDGE DETECTOR:
0 Intensity gradients are a function of image scale =>
operators of different sizes must be used.
0 Sudden intensity change will give a peak or trough in
first derivative or a zero crossing in second derivative.

01/20/25 12
Advanced Techniques for Edge Detection
0 The Marr-Hildreth edge detector
x2  y 2

G ( x, y ) e 2 2
,  : space constant.
Laplacian of Gaussian (LoG)
2  2 G ( x, y )  2 G ( x, y )
 G ( x, y )  2

x y 2
     y  x  y2 
2 2 2 2
x y
 x  2
  2 e 2    2 e 2 
x    y   
x2  y 2 x2  y 2
x 2
1  
2 2
y 1 2 
2 2
 4  2  e  4  2  e
     
x2  y 2
x y   
2 2 2
2 2
  e
01/20/25   4
 13
01/20/25 14
Marr-Hildreth Algorithm

1. Filter the input image with an nxn Gaussian


lowpass filter. N is the smallest odd integer greater
than or equal to 6

2. Compute the Laplacian of the image resulting from


step1

3. Find the zero crossing of the image from step 2

g ( x, y )   G ( x, y ) f ( x, y ) 
2

01/20/25 15
01/20/25 16
The Canny Edge Detector

0 Optimal for step edges corrupted by white noise.

0 The Objective

1. Low error rate


The edges detected must be as close as possible to the true edge

2. Edge points should be well localized


The edges located must be as close as possible to the true edges

3. Single edge point response


The number of local maxima around the true edge should be
minimum

01/20/25 17
The Canny Edge Detector: Algorithm (1)
Let f ( x, y ) denote the input image and
G ( x, y ) denote the Gaussian function:
x2  y 2

2 2
G ( x, y ) e

We form a smoothed image, f s ( x, y ) by


convolving G and f :
f s ( x, y ) G ( x, y ) f ( x, y )

01/20/25 18
The Canny Edge Detector: Algorithm(2)
Compute the gradient magnitude and direction (angle):
M ( x, y )  g x 2  g y 2
and
 ( x, y ) arctan( g y / g x )
where g x f s / x and g y f s / y

Note: any of the filter mask pairs in Fig.10.14 can be used


to obtain g x and g y

01/20/25 19
The Canny Edge Detector: Algorithm(3)
The gradient M ( x, y ) typically contains wide ridge around
local maxima. Next step is to thin those ridges.
Nonmaxima suppression:
Let d1 , d 2 , d3 , and d 4 denote the four basic edge directions for
a 3 3 region: horizontal, -45o , vertical,+45 , respectively.
1. Find the direction d k that is closest to  ( x, y ).
2. If the value of M ( x, y ) is less than at least one of its two
neighbors along d k , let g N ( x, y ) 0 (suppression);
otherwise, let g N ( x, y )  M ( x, y )
01/20/25 20
01/20/25 21
The Canny Edge Detector: Algorithm(4)
The final operation is to threshold g N ( x, y) to reduce
false edge points.

Hysteresis thresholding:
g NH ( x, y )  g N ( x, y ) TH
g NL ( x, y )  g N ( x, y ) TL
and
g NL ( x, y )  g NL ( x, y )  g NH ( x, y )

01/20/25 22

You might also like