![Page 1: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/1.jpg)
EE663Image ProcessingEdge Detection 1
Dr. Samir H. Abdul-Jauwad
Electrical Engineering Department
King Fahd University of Petroleum & Minerals
![Page 2: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/2.jpg)
Boundary Detection - Edges
• Boundaries of objects– Usually different materials/orientations,
intensity changes.
![Page 3: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/3.jpg)
![Page 4: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/4.jpg)
We also get:Boundaries of surfaces
![Page 5: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/5.jpg)
Boundaries of materials properties
![Page 6: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/6.jpg)
Boundaries of lighting
![Page 7: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/7.jpg)
Edge is Where Change Occurs
• Change is measured by derivative in 1D
• Biggest change, derivative has maximum magnitude
• Or 2nd derivative is zero.
![Page 8: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/8.jpg)
Noisy Step Edge
• Gradient is high everywhere.
• Must smooth before taking gradient.
![Page 9: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/9.jpg)
Implementing1D Edge Detection
1. Filter out noise: convolve with Gaussian
2. Take a derivative: convolve with [-1 0 1]
• Matlab
• We can combine 1 and 2.
• Matlab
![Page 10: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/10.jpg)
Implementing1D Edge Detection
3. Find the peak: Two issues:– Should be a local maximum.– Should be sufficiently high.
Matlab
![Page 11: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/11.jpg)
2D Edge Detection: Canny
1. Filter out noise– Use a 2D Gaussian Filter.
2. Take a derivative– Compute the magnitude of the gradient:
22
Gradient theis ,),(
yx
yx
JJJ
y
J
x
JJJJ
GIJ
![Page 12: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/12.jpg)
What is the gradient?
)0,(, ky
I
x
I
Change
No Change
![Page 13: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/13.jpg)
What is the gradient?
),0(, ky
I
x
I
No Change
Change
![Page 14: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/14.jpg)
What is the gradient?
)2,1(, kky
I
x
I
Much Change
Less ChangeGradient direction is perpendicular to edge.
Gradient Magnitude measures edge strength.
![Page 15: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/15.jpg)
Smoothing and Differentiation
• Need two derivatives, in x and y direction.
• We can use a derivative of Gaussian filter
• because differentiation is convolution, and convolution is associative
![Page 16: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/16.jpg)
(Forsyth & Ponce)
ScaleSmoothing• Eliminates noise edges.• Makes edges smoother.• Removes fine detail.• Matlab
![Page 17: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/17.jpg)
![Page 18: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/18.jpg)
fine scalehigh threshold
![Page 19: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/19.jpg)
coarse scale,high threshold
![Page 20: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/20.jpg)
coarsescalelowthreshold
![Page 21: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/21.jpg)
Finding the Peak
1) The gradient magnitude is large along thick trail; how do we identify the significant points?
2) How do we link the relevant points up into curves?
![Page 22: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/22.jpg)
We wish to mark points along the curve where the magnitude is biggest.We can do this by looking for a maximum along a slice normal to the curve(non-maximum suppression). These points should form a curve. There arethen two algorithmic issues: at which point is the maximum, and where is thenext one?
(Forsyth & Ponce)
![Page 23: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/23.jpg)
Non-maximumsuppression
At q, we have a maximum if the value is larger than those at both p and at r. Interpolate to get these values.
(Forsyth & Ponce)
![Page 24: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/24.jpg)
Predictingthe nextedge point
Assume the marked point is an edge point. Then we construct the tangent to the edge curve (which is normal to the gradient at that point) and use this to predict the next points (here either r or s).
(Forsyth & Ponce)
![Page 25: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/25.jpg)
Hysteresis
• Check that maximum value of gradient value is sufficiently large– drop-outs? use hysteresis
• use a high threshold to start edge curves and a low threshold to continue them.
![Page 26: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/26.jpg)
Demo of Edge Detection
![Page 27: EE663 Image Processing Edge Detection 1 Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals](https://reader030.vdocument.in/reader030/viewer/2022032800/56649d2a5503460f949ff58a/html5/thumbnails/27.jpg)
Why is Canny so Dominant
• Still widely used after 20 years.
1. Theory is nice (but end result same).
2. Details good (magnitude of gradient).
3. Hysteresis an important heuristic.
4. Code was distributed.
5. Perhaps this is about all you can do with linear filtering.