Presentation is loading. Please wait.

Presentation is loading. Please wait.

Filtering Course web page: vision.cis.udel.edu/cv March 5, 2003  Lecture 9.

Similar presentations


Presentation on theme: "Filtering Course web page: vision.cis.udel.edu/cv March 5, 2003  Lecture 9."— Presentation transcript:

1 Filtering Course web page: vision.cis.udel.edu/cv March 5, 2003  Lecture 9

2 Announcements Read Forsyth & Ponce, Chapter 8-8.3.1, 9.2-9.2.1 for Friday Homework 2 will be assigned on Friday and due Monday, March 17

3 Outline Systems, filtering Linear shift invariance = convolution Discrete vs. continuous convolution Low-pass filters Image pyramids

4 Imaging Systems An imaging system describes a functional transformation f of an image due to… –Physics: A real-world phenomenon such as blurring from defocus or fish-eye lens distortion –Filtering: A transformation we apply in order to Undo or mitigate the bad effects of a physical system (e.g., deblur, undistort, etc.) Emphasize or highlight particular image properties (e.g., color similarity, edges, etc.) II’I’ f

5 Linear Shift Invariance Possible properties of f –Superposition: f(I 1 + I 2 ) = f(I 1 ) + f(I 2 ) –Scaling: f(®I) = ®f(I) –Shift invariance: f( Shift (I, k)) = Shift (f(I), k) A system with these properties is performing convolution

6 What’s Not a Convolution? Nonlinear systems –E.g., radial distortion of fish-eye lens is not LSI because geometric transformation depends on pixel location f courtesy of M. Fiala

7 Impulse Response One way to look at what a convolution is doing is to measure its effect on a ± function –Reasonable ± approximation is a black image containing a single bright dot of light at the origin The output is f ’s impulse response (aka a point-spread function) Convolving an image consists of measuring f ’s response to the brightness (a different impulse) at every image location

8 Continuous Convolution Definition: Sifting property: If I is the delta function ±, then the integral is 0 everywhere but at x = 0, y = 0, and I’(u, v) = f(u, v) (because ± integrates to 1). Different values of u, v thus map out the point spread function An arbitrary I can be represented as an infinite collection of shifted, scaled impulses

9 Convolution Notes Notation: I’ = f ¤ I (book uses ¤¤ for 2-D convolution) Note the assumption that both the impulse function and the images are continuous and defined everywhere Properties –Commutative –Associative

10 Discrete Convolution Sum instead of integral: I’ = K ¤ I is defined by: I’(u, v) = § x, y K(u ¡ x, v ¡ y) I(x, y) where the kernel K approximates the impulse function f by sampling from it where it is non-zero –Think of the last part of HW 1—e.g., if f is a Gaussian, the matrix of Z - values would be K Convolution: Correlation with kernel rotated 180  –This distinction goes away for isotropic kernels Some ways to interpret what the kernel is doing –As a template being matched by correlation (non-normalized) –As simply a set of weights on the corresponding image pixels 111 21 1

11 Dealing with Image Edges Only convolve with interior –Shrinks image Zero-padding –Results in spurious gradients Border replication Symmetric: Reflect image at border b so that I(b + i) = I(b ¡ i) –Results in spurious 2 nd -derivatives 3 2 1 2 2 1 3 2 32 21 22 32 1-2 24 111

12 Filtering Example 1: 1 12 111 2223 2133 2212 1322 Rotate 1 12 111 (using zero-padding)

13 Step 1 3 2 1 2 2 1 3 2 32 21 22 325 3 2 1 2 2 1 3 2 32 21 22 32 1-2 24 111 1 12 111

14 Step 2 3 2 1 2 2 1 3 2 32 21 22 3245 3 2 1 2 2 1 3 2 32 21 22 32 3-2 24 111 1 12 111

15 Step 3 3 2 1 2 2 1 3 2 32 21 22 32445 3 2 1 2 2 1 3 2 32 21 22 32 3-3 34-2 111 1 12 111

16 Step 4 3 2 1 2 2 1 3 2 32 21 22 3244-25 3 2 1 2 2 1 3 2 32 21 22 32 1-3 16-2 111 1 12 111

17 Step 5 3 2 1 2 2 1 3 2 32 21 22 3244 9 -25 3 2 1 2 2 1 3 2 32 21 22 32 2 14 221 1 12 111

18 Step 6 3 2 1 2 2 1 3 2 32 21 22 32 6 44 9 -25 3 2 1 2 2 1 3 2 32 21 22 32 1 32 222 1 12 111

19 and so on…

20 Final Result 2223 2133 2212 1322 12 7 6 4 8 6 14 4 59 59 511 -25 I’I’I 1 12 111 Why is I’ large in some places and small in others?

21 Smoothing (Low-Pass) Filters Problem: How to suppress noise, aliasing? –If object reflectance changes slowly and noise at each pixel is independent, then we want to replace each pixel with something like the average of neighbors Disadvantage: Sharp (high-frequency) features lost Types –Mean filter (box) –Median (nonlinear) –Gaussian 111 111 111 3 x 3 box filter

22 Example: Gaussian Noise from Forsyth & Ponce

23 Box Filter: Smoothing 7 x 7 kernelOriginal image

24 Filtering in Matlab imfilter(I, K) filters image I with kernel K –Default filtering is correlation (no kernel rotation) –Can set options on border handling corr2, conv2 are the generic versions Kernel creation –Custom (like you did in the last part of HW 1) –fspecial function


Download ppt "Filtering Course web page: vision.cis.udel.edu/cv March 5, 2003  Lecture 9."

Similar presentations


Ads by Google