Summary of Lecture 8
Summary of Lecture 8
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 1
Fourier Transforms and Gibbs Phenomenon
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 2
Fourier Transforms and Gibbs Phenomenon contd.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 3
Images and Edges
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 4
Images and Edges contd.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 5
Edges and Noise
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 6
Edge Detection - Motivation
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 7
Edge Detection Algorithms - Continuous Time
Suppose x(t) is a continuous time signal containing “edges”. The edges can
be detected in two ways via:
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 8
Edge Detection Algorithms - contd.
2
2. Calculating y(t) = d dtx(t)
2 and finding the locations ti of the zero crossings
of y(t), i.e., there is an edge at location ti if:
y(ti + ²) > 0 ⇒ y(ti − ²) < 0, ∀ 0 < ² << 1
or
y(ti + ²) < 0 ⇒ y(ti − ²) > 0, ∀ 0 < ² << 1
Let
y(t) |y(t)| > Te
c(t) = (1)
0 otherwise
where Te > 0 is a threshold. In order to incorporate “non-ideal” sig-
nals we will say that there is an edge at location ti if c(t) has a zero
crossing at ti. We will still refer to this algorithm as detecting the
zero crossings.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 9
Edge Detection Algorithms - Discrete Time
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 10
General Algorithm
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 11
Gradient Operators
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 12
Gradient Operators contd.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 13
First Derivative Operators
−1 0 1
−1 0 1
• Simple: [−1 0 1], Prewitt:
−1 0 1 , Sobel:
−2 0 2
−1 0 1 −1 0 1
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 14
Example - Vertical Edges
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 15
Example - Vertical Edges contd.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 16
Directionless Second Derivative Operators
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 17
Edge Detection and Noise
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 18
The Laplacian of a Gaussian Gradient Operator
2 2 2
• The Gaussian sequence defined by L(m, n) = e−(m +n )/2σ is a low-pass
sequence and can be used as a low-pass filter (σ controls the band-
width of this filter).
• The Laplacian of a Gaussian H = Z⊗L can thus be defined as a second
derivative gradient operator with favorable performance under noisy
conditions.
•σ is chosen large for very noisy conditions and small for relatively
noiseless conditions.
• Typically L(m, n) is employed as a finite extent sequence P1 × P2 (m, n
must be centered around zero −1 ≤ m, n ≤ 1 etc.). (Large values of σ
will in general require larger extents.)
• Edges are detected using the zero crossings of the filtered output (with
Te).
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 19
Example
P1 = P2 = 3,Te = 30,σ = 2
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 20
Human Visual System and Mach Bands
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 21
Low-pass Response of the Human Visual System
• The human visual system low-pass filters the scenes under observation.
• We will exploit this observation by “hiding” processing errors where
humans cannot see them.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 22
Summary
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 23
Homework IX
1. Detect horizontal and vertical edges in your image using the simple, Prewitt and Sobel operators.
Show horizontal edge maps, vertical edge maps and combined edge maps. Comment on differences
between horizontal and vertical edge maps. Experiment with the relevant thresholds and try to
choose them as best as you can.
2. Detect edges in your image by using the zero crossings of the Laplacian of Gaussian operator.
Adjust P1 , P2 , Te , σ to obtain the best results.
3. Repeat 2 by starting with a noisy version of your image (say with image+10randn()). Try to
adjust the parameters to match noiseless performance. Comment on the differences of the result
with 2.
4. Generate a one dimensional signal and its perceived version as I have done. Try to find a filter
which when convolved with the original signal gives the “perceived” signal. (Hint: Use DFTs of
the two signals and use the convolution → multiplication property. Be wary of divisions by zeros
or small values.) Is the filter you have discovered low-pass? Show the 1D DFT and the filter itself.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 24
References
[1] A. K. Jain, Fundamentals of Digital Image Processing. Englewood Cliffs, NJ: Prentice Hall, 1989.
c Onur G. Guleryuz, Department of Electrical and Computer Engineering, Polytechnic University, Brooklyn, NY
° 25