Title: Computer Vision
1Computer Vision
- Spring 2012 15-385,-685
- Instructor S. Narasimhan
- Wean Hall 5409
- T-R 1030am 1150am
2- Image Processing and Filtering
- Lecture 3
3Image as a Function
- We can think of an image as a function, f,
- f R2 ? R
- f (x, y) gives the intensity at position (x, y)
- Realistically, we expect the image only to be
defined over a rectangle, with a finite range - f a,bxc,d ? 0,1
- A color image is just three functions pasted
together. We can write this as a vector-valued
function
4Image as a Function
5Image Processing
- Define a new image g in terms of an existing
image f - We can transform either the domain or the range
of f - Range transformation
- What kinds of operations can this perform?
6Point Operations
7Point Processing
Nonlinear Lower Contrast
Original
Darken
Lower Contrast
Nonlinear Raise Contrast
Invert
Lighten
Raise Contrast
8Point Processing
Nonlinear Lower Contrast
Original
Darken
Lower Contrast
Nonlinear Raise Contrast
Invert
Lighten
Raise Contrast
9Neighborhood Operations
10Neighborhood operations
Image
Edge detection
Blur
11Image Processing
- Some operations preserve the range but change the
domain of f - What kinds of operations can this perform?
- Still other operations operate on both the domain
and the range of f .
12Face Morphing
13Linear Shift Invariant Systems (LSIS)
Linearity
Shift invariance
14Example of LSIS
Defocused image ( g ) is a processed version of
the focused image ( f )
Ideal lens is a LSIS
Linearity Brightness variation Shift
invariance Scene movement
(not valid for lenses with non-linear distortions)
15Convolution
LSIS is doing convolution convolution is linear
and shift invariant
kernel h
16Convolution - Example
Eric Weinsteins Math World
17Convolution - Example
1
1
2
-1
-2
18Convolution Kernel Impulse Response
- What h will give us g f ?
Dirac Delta Function (Unit Impulse)
Sifting property
19Point Spread Function
Optical System
scene
image
- Ideally, the optical system should be a Dirac
delta function.
20Point Spread Function
normal vision
myopia
hyperopia
astigmatism
Images by Richmond Eye Associates
21Properties of Convolution
22Images are Discrete and Finite
23Averaging
Lets think about averaging pixel values
Which is faster?
24Averaging
The convolution kernel
25Gaussian Smoothing
Gaussian kernel
(truncate, if necessary)
Use two 1D Gaussian filters
26Gaussian Smoothing
- A Gaussian kernel gives less weight to pixels
further from the center of the window (5x5,
sigma0.5) - 0.0000 0.0000 0.0002 0.0000 0.0000
- 0.0000 0.0113 0.0837 0.0113 0.0000
- 0.0002 0.0837 0.6187 0.0837 0.0002
- 0.0000 0.0113 0.0837 0.0113 0.0000
- 0.0000 0.0000 0.0002 0.0000 0.0000
- This kernel is an approximation of a Gaussian
function
27Gaussian Smoothing
original
28Mean vs. Gaussian filtering
29Gaussian Smoothing
by Charles Allen Gillbert
by Harmon Julesz
http//www.michaelbach.de/ot/cog_blureffects/index
.html
30Gaussian Smoothing
http//www.michaelbach.de/ot/cog_blureffects/index
.html
31Border Problem
32Border Problem
- Ignore
- Output image will be smaller than original
- Pad with constant values
- Can introduce substantial 1st order derivative
values - Pad with reflection
- Can introduce substantial 2nd order derivative
values
33Median Filter
- Smoothing is averaging
- (a) Blurs edges
- (b) Sensitive to outliers
(a)
(b)
- Sort values around the pixel
- Select middle value (median)
- Non-linear (Cannot be implemented with
convolution)
34Salt and pepper noise
Gaussian noise
3x3
5x5
7x7
35Correlation
template
How do we locate the template in the image?
Cross-correlation
36Cross-correlation
Note
Auto-correlation
37Normalized Correlation
- Account for energy differences
38Announcements
- Project 1 will be out later this evening.
- WARNING! Start projects early.
39Next Class
- Image Processing and Filtering (continued)
- Fourier or frequency domain analysis
- Horn, Chapter 6