Convolution%20and%20Edge%20Detection - PowerPoint PPT Presentation

About This Presentation
Title:

Convolution%20and%20Edge%20Detection

Description:

imagesc(conv2(clown,dx,'same'); lg = fspecial('log',15,2); lclown = conv2(clown,lg,'same' ... imagesc(clown .2*lclown) 18. What does blurring take away? ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 24
Provided by: efr5
Category:

less

Transcript and Presenter's Notes

Title: Convolution%20and%20Edge%20Detection


1
Convolution and Edge Detection
15-463 Computational Photography Alexei Efros,
CMU, Fall 2005
Some slides from Steve Seitz
2
Fourier spectrum
3
Fun and games with spectra
4
Gaussian filtering
  • A Gaussian kernel gives less weight to pixels
    further from the center of the window
  • This kernel is an approximation of a Gaussian
    function

0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 0 90 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
1 2 1
2 4 2
1 2 1
5
Mean vs. Gaussian filtering
6
Convolution
  • Remember cross-correlation
  • A convolution operation is a cross-correlation
    where the filter is flipped both horizontally and
    vertically before being applied to the image
  • It is written
  • Suppose H is a Gaussian or mean kernel. How does
    convolution differ from cross-correlation?

7
The Convolution Theorem
  • The greatest thing since sliced (banana) bread!
  • The Fourier transform of the convolution of two
    functions is the product of their Fourier
    transforms
  • The inverse Fourier transform of the product of
    two Fourier transforms is the convolution of the
    two inverse Fourier transforms
  • Convolution in spatial domain is equivalent to
    multiplication in frequency domain!

8
Fourier Transform pairs
9
2D convolution theorem example
F(sx,sy)
f(x,y)

h(x,y)
H(sx,sy)
g(x,y)
G(sx,sy)
10
Edges in images
11
Image gradient
  • The gradient of an image
  • The gradient points in the direction of most
    rapid change in intensity

12
Effects of noise
  • Consider a single row or column of the image
  • Plotting intensity as a function of position
    gives a signal

How to compute a derivative?
Where is the edge?
13
Solution smooth first
Where is the edge?
14
Derivative theorem of convolution
  • This saves us one operation

15
Laplacian of Gaussian
  • Consider

Laplacian of Gaussian operator
Where is the edge?
Zero-crossings of bottom graph
16
2D edge detection filters
Gaussian
derivative of Gaussian
17
MATLAB demo
g fspecial('gaussian',15,2) imagesc(g) surfl(g
) gclown conv2(clown,g,'same') imagesc(conv2(cl
own,-1 1,'same')) imagesc(conv2(gclown,-1
1,'same')) dx conv2(g,-1 1,'same') imagesc(
conv2(clown,dx,'same') lg fspecial('log',15,2)
lclown conv2(clown,lg,'same') imagesc(lclown)
imagesc(clown .2lclown)
18
What does blurring take away?
original
19
What does blurring take away?
smoothed (5x5 Gaussian)
20
Edge detection by subtraction
Why does this work?
smoothed original
21
Gaussian - image filter
FFT
Gaussian
delta function
Laplacian of Gaussian
22
What is happening?
23
Unsharp Masking
Write a Comment
User Comments (0)
About PowerShow.com