Beruflich Dokumente
Kultur Dokumente
Edge Detection
Detection of Discontinuities
Matched Filter Example
>> a=[0 0 0 0 1 2 3 0 0 0 0 2 2 2 0 0 0 0 1 2 -2 -1 0 0 0 0];
>> figure; plot(a);
>> h1 = [-1 -2 2 1]/10;
>> b1 = conv(a,h1); figure; plot(b1);
Bahadir K. Gunturk 2
Detection of Discontinuities
Point Detection Example:
Apply a high-pass filter.
A point is detected if the response is larger than a positive
threshold.
| R |> T
Threshold
The idea is that the gray level of an isolated point will be quite
different from the gray level of its neighbors.
Bahadir K. Gunturk 3
Detection of Discontinuities
Point Detection
Detected point
Bahadir K. Gunturk 4
Detection of Discontinuities
Line Detection Example:
R1 R2 R3 R4
Bahadir K. Gunturk 5
Detection of Discontinuities
Line Detection Example:
Bahadir K. Gunturk 6
Detection of Discontinuities
Edge Detection:
An edge is the boundary between two regions with relatively
distinct gray levels.
Edge detection is by far the most common approach for
detecting meaningful discontinuities in gray level. The reason
is that isolated points and thin lines are not frequent
occurrences in most practical applications.
The idea underlying most edge detection techniques is the
computation of a local derivative operator.
Bahadir K. Gunturk 7
Origin of Edges
depth discontinuity
illumination discontinuity
Bahadir K. Gunturk 8
Profiles of image intensity
edges
Bahadir K. Gunturk 9
Image gradient
The gradient of an image:
Bahadir K. Gunturk 10
The discrete gradient
How can we differentiate a digital image f[x,y]?
Option 1: reconstruct a continuous image, then take gradient
Option 2: take discrete derivative (finite difference)
Bahadir K. Gunturk 11
Effects of noise
Consider a single row or column of the image
Plotting intensity as a function of position gives a signal
Bahadir K. Gunturk 12
Solution: smooth first
Bahadir K. Gunturk 14
Laplacian of Gaussian
Consider
Laplacian of Gaussian
operator
Laplacian of Gaussian
Bahadir K. Gunturk 16
Edge Detection
Possible filters to find gradients along vertical and horizontal directions:
Bahadir K. Gunturk 17
Edge Detection
Bahadir K. Gunturk 18
Edge Detection
Bahadir K. Gunturk 19
Edge Detection
The Laplacian of an image f(x,y) is a second-order
derivative defined as
�2 f �2 f
�f = 2 + 2
2
�x �y
Digital approximations:
Bahadir K. Gunturk 20
Edge Detection
Bahadir K. Gunturk 21
Edge Detection
The Laplacian of a Gaussian filter
A digital approximation:
0 0 1 0 0
0 1 2 1 0
1 2 -16 2 1
0 1 2 1 0
0 0 1 0 0
Bahadir K. Gunturk 22
The Canny edge detector
thresholding
Bahadir K. Gunturk 25
The Canny edge detector
thinning
(non-maximum suppression)
Bahadir K. Gunturk 26
Edge detection by
subtraction
Bahadir K. Gunturk
original 27
Edge detection by
subtraction
Bahadir K. Gunturk
smoothed (5x5 Gaussian) 28
Edge detection by
subtraction
Why does
this work?
smoothed – original
Bahadir K. Gunturk 29
Gaussian - image filter
Bahadir K. Gunturk 30
Laplacian of Gaussian