Lecture1 2
Lecture1 2
Reading
• Szeliski, Chapter 3.1-3.2
What is an image?
What is an image?
Digital Camera
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 20 0 255 255 255 255 255 255 255
=
255 255 75 95 95 75 255 255 255 255 255 255
255 255 96 127 145 175 255 255 255 255 255 255
255 255 127 145 175 175 175 255 255 255 255 255
255 255 127 145 200 200 175 175 95 255 255 255
255 255 127 145 200 200 175 175 95 47 255 255
255 255 127 145 145 175 127 127 95 47 255 255
255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255
g (x,y) = f (x,y) + 20
10 5 3 Some function
4 5 1 7
1 1 7
Source: L. Zhang
Linear filtering
• One simple version of filtering: linear filtering
(cross-correlation, convolution)
– Replace each pixel by a linear combination (a weighted
sum) of its neighbors
• The prescription for the linear combination is called
the “kernel” (or “mask”, “filter”)
10 5 3 0 0 0
4 6 1 0 0.5 0 8
1 1 8 0 1 0.5
Local image data kernel Modified image data
Source: L. Zhang
Cross-correlation
Let be the image, be the kernel (of
size 2k+1 x 2k+1), and be the output
image
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 20 10
0 0 0 90 90 90 90 90 0 0 0 20 40 60 60 60 40 20
1 1 1 0 0 0 90 90 90 90 90 0 0 0 30 60 90 90 90 60 30
1
1
1
1
1
1
*
0
0
0
0
0
0
0
0
0
90
90
90
90
0
90
90
90
90
90
90
90
90
90
90
0
0
0
0
0
0
= 0
0
0
30
30
20
50
50
30
80
80
50
80
80
50
90
90
60
60
60
40
30
30
20
0 0 0 0 0 0 0 0 0 0 10 20 30 30 30 30 20 10
0 0 90 0 0 0 0 0 0 0 10 10 10 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Mean filtering/Moving average
Mean filtering/Moving average
Mean filtering/Moving average
Mean filtering/Moving average
Mean filtering/Moving average
Mean filtering/Moving average
Linear filters: examples
0 0 0
=
* 0
0
1
0
0
0
Source: D. Lowe
Linear filters: examples
0 0 0
=
* 1
0
0
0
0
0
Source: D. Lowe
Linear filters: examples
1 1 1
=
* 1
1
1
1
1
1
Source: D. Lowe
Linear filters: examples
-
0 0 0 1 1 1
=
* 0
0
2
0
0
0
1
1
1
1
1
1
Sharpening filter
Original
Source: D. Lowe
Sharpening
Source: D. Lowe
Gaussian Kernel
5 x 5, = 1
Source: C. Rasmussen
Gaussian filters
Increasing
Mean vs. Gaussian filtering
* =
Source: K. Grauman
Sharpening revisited
• What does blurring take away?
– =
original smoothed (5x5) detail
+α =
original detail sharpened
Source: S. Lazebnik
Filters: Thresholding