Download presentation
Presentation is loading. Please wait.
Published byAlisha Stafford Modified over 9 years ago
1
CS559: Computer Graphics Lecture 3: Digital Image Representation Li Zhang Spring 2008
2
Today Eyes Cameras
3
Image as a discreet function Represented by a matrix
4
What is image filtering? Modify the pixels in an image based on some function of a local neighborhood of the pixels. 514 171 5310 Local image data 7 Modified image data Some function
5
Linear functions Simplest: linear filtering. – Replace each pixel by a linear combination of its neighbors. The prescription for the linear combination is called the “convolution kernel”. 514 171 5310 0.5 00 10 000 Local image datakernel 7 Modified image data
6
Convolution I
7
Linear filtering (warm-up slide) original 0 Pixel offset coefficient 1.0 ?
8
Linear filtering (warm-up slide) original 0 Pixel offset coefficient 1.0 Filtered (no change)
9
Linear filtering 0 Pixel offset coefficient original 1.0 ?
10
shift 0 Pixel offset coefficient original 1.0 shifted
11
Linear filtering 0 Pixel offset coefficient original 0.3 ?
12
Blurring 0 Pixel offset coefficient original 0.3 Blurred (filter applied in both dimensions).
13
0 Pixel offset coefficient 0.3 original 8 filtered 2.4 impulse Blur Examples
14
0 Pixel offset coefficient 0.3 original 8 filtered 4 8 4 impulse edge 0 Pixel offset coefficient 0.3 original 8 filtered 2.4 Blur Examples
15
original 0 2.0 ? 0 1.0 Linear filtering (warm-up slide)
16
original 0 2.0 0 1.0 Filtered (no change) Linear Filtering (no change)
17
original 0 2.0 0 0.33 ? Linear Filtering
18
(remember blurring) 0 Pixel offset coefficient original 0.3 Blurred (filter applied in both dimensions).
19
original 0 2.0 0 0.33 Sharpened original Sharpening
20
Sharpening example coefficient -0.3 original 8 Sharpened (differences are accentuated; constant areas are left untouched). 11.2 1.7 -0.25 8
21
Sharpening beforeafter
22
Spatial resolution and color R G B original
23
Blurring the G component R G B original processed
24
Blurring the R component original processed R G B
25
Blurring the B component original R G B processed
26
L a b A rotation of the color coordinates into directions that are more perceptually meaningful: L: luminance, a: red-green, b: blue-yellow Lab Color Component
27
L a b original processed Bluring L
28
original L a b processed Bluring a
29
original L a b processed Bluring b
30
Application to image compression (compression is about hiding differences from the true image where you can’t see them).
31
Edge Detection Convert a 2D image into a set of curves – Extracts salient features of the scene – More compact than pixels
32
How can you tell that a pixel is on an edge?
33
Image gradient The gradient of an image: The gradient direction is given by: The gradient points in the direction of most rapid change in intensity –how does the gradient relate to the direction of the edge? The edge strength is given by the gradient magnitude
34
Effects of noise Consider a single row or column of the image – Plotting intensity as a function of position gives a signal Where is the edge? How to compute a derivative?
35
Where is the edge? Solution: smooth first Look for peaks in
36
Derivative theorem of convolution This saves us one operation:
37
Laplacian of Gaussian Consider Laplacian of Gaussian operator Where is the edge?Zero-crossings of bottom graph
38
Canny Edge Detector Smooth image I with 2D Gaussian: Find local edge normal directions for each pixel Along this direction, compute image gradient Locate edges by finding max gradient magnitude (Non-maximum suppression)
39
Non-maximum Suppression Check if pixel is local maximum along gradient direction – requires checking interpolated pixels p and r
40
The Canny Edge Detector original image (Lena)
41
The Canny Edge Detector magnitude of the gradient
42
The Canny Edge Detector After non-maximum suppression
43
Canny Edge Detector Canny with original The choice of depends on desired behavior –large detects large scale edges –small detects fine features
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.