Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Vision Spring 2012 15-385,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.

Similar presentations


Presentation on theme: "Computer Vision Spring 2012 15-385,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am."— Presentation transcript:

1 Computer Vision Spring 2012 15-385,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am

2 Image Processing and Filtering Lecture #3

3 Image as a Function We can think of an image as a function, f, f: R 2  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,b] x [c,d]  [0,1] A color image is just three functions pasted together. We can write this as a “ vector- valued ” function:

4 Image as a Function

5 Image 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?

6 Point Operations

7 Point Processing Original Darken Invert Lighten Lower Contrast Raise Contrast Nonlinear Raise Contrast Nonlinear Lower Contrast

8 Point Processing Original Darken Invert Lighten Lower Contrast Raise Contrast Nonlinear Raise Contrast Nonlinear Lower Contrast x + 128x * 2 255 - x ((x / 255.0) ^2) * 255.0 x - 128x / 2x ((x / 255.0) ^ 0.33) * 255.0

9 Neighborhood Operations

10 Neighborhood operations Image Edge detectionBlur

11 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. Image Processing

12 Face Morphing

13 Linear Shift Invariant Systems (LSIS) Linearity: Shift invariance:

14 Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) Ideal lens is a LSIS LSIS Linearity: Brightness variation Shift invariance: Scene movement (not valid for lenses with non-linear distortions)

15 Convolution LSIS is doing convolution; convolution is linear and shift invariant kernel h

16 Convolution - Example Eric Weinstein’s Math World

17 12-2 1 1 1 1 1 Convolution - Example

18 Convolution Kernel – Impulse Response What h will give us g = f ? Dirac Delta Function (Unit Impulse) Sifting property:

19 Point Spread Function Optical System sceneimage Ideally, the optical system should be a Dirac delta function. Optical System point sourcepoint spread function However, optical systems are never ideal. Point spread function of Human Eyes

20 Point Spread Function normal visionmyopiahyperopia Images by Richmond Eye Associates astigmatism

21 Properties of Convolution Commutative Associative Cascade system

22 Images are Discrete and Finite Convolution Fourier Transform Inverse Fourier Transform

23 Averaging Let’s think about averaging pixel values For n=2, convolve pixel values with 121 2D images: 121 (a) use then 1 2 1 121 or (b) use 1 2 1 1 2 1 1 2 1 2 4 2 Which is faster?

24 The convolution kernel large Repeated averaging Gaussian smoothing Averaging

25 Gaussian Smoothing Gaussian kernel pixels Filter size…can be very large (truncate, if necessary) 2D Gaussian is separable! Use two 1D Gaussian filters

26 A Gaussian kernel gives less weight to pixels further from the center of the window (5x5, sigma=0.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: Gaussian Smoothing

27 original

28 Mean vs. Gaussian filtering

29 Gaussian Smoothing http://www.michaelbach.de/ot/cog_blureffects/index.html by Charles Allen Gillbert by Harmon & Julesz

30 Gaussian Smoothing http://www.michaelbach.de/ot/cog_blureffects/index.html

31 Border Problem

32 Ignore –Output image will be smaller than original Pad with constant values –Can introduce substantial 1 st order derivative values Pad with reflection –Can introduce substantial 2 nd order derivative values

33 Median 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) Median filtering sortmedian

34 3x3 5x5 7x7 Salt and pepper noise Gaussian noise

35 Correlation How do we locate the template in the image? Minimize Maximize Cross-correlation template

36 Cross-correlation Note: Auto-correlation We need to be the maximum! A B C f t Problem:

37 Normalized Correlation Account for energy differences

38 Announcements Project 1 will be out later this evening. WARNING! Start projects early.

39 Next Class Image Processing and Filtering (continued) Fourier or frequency domain analysis Horn, Chapter 6


Download ppt "Computer Vision Spring 2012 15-385,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am."

Similar presentations


Ads by Google