Download presentation
Presentation is loading. Please wait.
Published byLynn Opal Barton Modified over 8 years ago
1
Lecture 1: Images and image filtering CS4670/5670: Intro to Computer Vision Noah Snavely Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htmhttp://cvcl.mit.edu/hybridimage.htm
2
Lecture 1: Images and image filtering CS4670: Computer Vision Noah Snavely Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htmhttp://cvcl.mit.edu/hybridimage.htm
3
Lecture 1: Images and image filtering CS4670: Computer Vision Noah Snavely Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htmhttp://cvcl.mit.edu/hybridimage.htm
4
CS4670: Computer Vision Noah Snavely Hybrid Images, Oliva et al., http://cvcl.mit.edu/hybridimage.htmhttp://cvcl.mit.edu/hybridimage.htm Lecture 1: Images and image filtering
5
Reading Szeliski, Chapter 3.1-3.2
6
What is an image?
7
Digital Camera The Eye Source: A. Efros We’ll focus on these in this class (More on this process later)
8
What is an image? A grid (matrix) of intensity values (common to use one byte per value: 0 = black, 255 = white) = = 255 200255 75 255 7595 75255 96127145175255 127145175 255 127145200 175 95255 127145200 175 9547255 127145 175127 9547255 74127 95 47255 74 255
9
We can think of a (grayscale) image as a function, f, from R 2 to R: – f (x,y) gives the intensity at position (x,y) – A digital image is a discrete (sampled, quantized) version of this function What is an image? x y f (x, y) snoop 3D view
10
Image transformations As with any function, we can apply operators to an image We’ll talk about a special kind of operator, convolution (linear filtering) g (x,y) = f (x,y) + 20 g (x,y) = f (-x,y)
11
Question: Noise reduction Given a camera and a still scene, how can you reduce noise? Take lots of images and average them! What’s the next best thing? Source: S. Seitz
12
Image filtering Modify the pixels in an image based on some function of a local neighborhood of each pixel 514 171 5310 Local image data 7 Modified image data Some function Source: L. Zhang
13
Linear filtering One simple version: 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”) 0.5 00 10 000 kernel 8 Modified image data Source: L. Zhang Local image data 614 181 5310
14
Cross-correlation This is called a cross-correlation operation: Let be the image, be the kernel (of size 2k+1 x 2k+1), and be the output image Can think of as a “dot product” between local neighborhood and kernel for each pixel
15
Convolution Same as cross-correlation, except that the kernel is “flipped” (horizontally and vertically) Convolution is commutative and associative This is called a convolution operation:
16
1D Demo
17
Convolution Adapted from F. Durand
18
Mean filtering 0000000000 0000000000 00090 00 000 00 000 00 000 0 00 000 00 0000000000 00 0000000 0000000000 111 111 111 * = 0102030 2010 0204060 4020 0306090 6030 0 5080 906030 0 5080 906030 0203050 604020 102030 2010 00000
19
Example filters Original 111 111 111 Blur (with a box filter) Source: D. Lowe
20
Linear filters: examples 000 010 000 Original Identical image Source: D. Lowe * =
21
Linear filters: examples 000 001 000 Original Shifted left By 1 pixel Source: D. Lowe * =
22
Linear filters: examples Original 111 111 111 Blur (with a mean filter) Source: D. Lowe * =
23
Linear filters: examples Original 111 111 111 000 020 000 - Sharpening filter (accentuates edges) Source: D. Lowe = *
24
Sharpening Source: D. Lowe
25
Smoothing with box filter revisited Source: D. Forsyth
26
Gaussian Kernel Source: C. Rasmussen
27
Gaussian filters = 30 pixels= 1 pixel = 5 pixels = 10 pixels
28
Mean vs. Gaussian filtering
29
Gaussian filter Removes “high-frequency” components from the image (low-pass filter) Convolution with self is another Gaussian – Convolving twice with Gaussian kernel of width = convolving once with kernel of width Source: K. Grauman * =
30
Sharpening revisited What does blurring take away? original smoothed (5x5) – detail = sharpened = Let’s add it back: originaldetail + α Source: S. Lazebnik
31
Sharpen filter Gaussian scaled impulse Laplacian of Gaussian image blurred image unit impulse (identity)
32
Sharpen filter unfiltered filtered
33
“Optical” Convolution Source: http://lullaby.homepage.dk/diy-camera/bokeh.html Bokeh: Blur in out-of-focus regions of an image. Camera shake * = Source: Fergus, et al. “Removing Camera Shake from a Single Photograph”, SIGGRAPH 2006
34
Questions? For next time: – Read Szeliski, Chapter 3.1-3.2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.