Top Banner
Comp 665 Convolution
18

Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Comp 665

Convolution

Page 2: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Questions?

• Ask here first.

• Likely someone else has the same question.

Page 3: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Modeling the imaging process

• We know how to compute where points in the world will map on the image plane

• Now, how will they be changed?

Page 4: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Impulse Response Function

• Point Spread Function

• What is the image of a point?– Shape of pinhole for points at infinity– Typically a little blob for a good lens– Could have aberrations and are distance, color,

or position dependent.

• What happens as we enlarge the pinhole?

Page 5: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Blurring as convolution:IRF’s and apertures

• Blurring by convolution with impulse response function: Iblurred(x)= Iinput(y) h(x-y) dy– Replace each point y by y’s intensity times IRF h centered at

y• h(x-y) is effect of a fixed y on x over various image points x

– Sum up over all such points

• Aperture in image space x: – effect of y on x over various y: h(-[y-x])– weighting of various input image points in producing image

at a fixed point x

Page 6: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Linear Systems

• Favorite model because we have great tools

• F(a+b) = F(a) + F(b), F(k a) = k F(a)

• Shift Invariant

• Time Invariant

• Is camera projection linear?

Page 7: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Properties of convolution:Iout(x) = Iin(y) h(x-y) dy

• h(x) is called the convolution kernel• Linear in both inputs, Iin and h• Symmetric in its inputs, Iin and h • Cascading convolutions is convolution with the

convolution of the two kernels: (I * h1)* h2 = I *(h1* h2)– Thus cascading of convolution of two Gaussians

produces Gaussian with = (12 + 2

2)½

• Any linear, shift invariant operator can be written as a convolution or a limit of one

Page 8: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Linear Shift-Invariant Operators

• Blurring with IRF that is constant over the scene

• Viewing scene through any fixed aperture

• All derivatives D– So D(I * h1) = DI *h1= I *Dh1

• Designed operations, e.g., for smoothing, noise removal, sharpening, etc.

• Can be applied to parametrized functions of u– E.g., smoothing surfaces

Page 9: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Convolution Equation1

0

[ ] [ ] [ ]M

j

y i h j x i j

Notorious flip!

•For non-causal symmetric impulse responses it doesn’t matter

•For causal or non-symmetric impulse responses it is critical!

•Important for relating convolution to correlation

•Some texts (web sites) reverse the input, don’t do that

•Reverse the impulse response instead

Page 10: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

1D Convolution CodeOutput side algorithmfor i indexing y sum = 0 for j indexing h sum += h[j] * x[i-j] y[i] = sum

Input side algorithmzero yfor i indexing y for j indexing h y[i+j] += x[i]*h[j]

Page 11: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Impulse Response

Page 12: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Example Impulse Responses

Page 13: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Example Impulse Responses

Page 14: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Derivative of Gaussian Weighting Functions

Gaussian: G

Barness along u: Guu

Edgeness along u: Gu

Page 15: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Properties of Convolution

• Commutative: a*b = b*a

• Associative: (a*b)*c = a*(b*c)

• Distributive: a*b + a*c = a*(b+c)

• Central Limit Theorem: convolve a pulse with itself enough times you get a Gaussian

Page 16: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Properties of convolution,continued

• For any convolution kernel h(x), if the input Iin(x) is a sinusoid with wavelength (level of detail) 1/, i.e., Iin(x) = A cos(2x) + B sin(2x), then the output of the convolution is a sinusoid with the same wavelength (level of detail), i.e., Iin * h = C cos(2x) + D sin(2x), for some C and D dependent on A, B, and h(x)

Page 17: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Sampling and integration(digital images)

• Model– Within-pixel integration at all points

• Has its own IRF, typically rectangular

– Then sampling

• Sampling = multiplication by pixel area brush function – Brush function is sum of impulses at pixel centers– Sampling = aliasing: in sinusoidal decomposition higher

frequency components masquerading as and thus polluting lower frequency components

– Nyquist frequency: how finely to sample to have adequately low effect of aliasing

Page 18: Comp 665 Convolution. Questions? Ask here first. Likely someone else has the same question.

Fun with Convolutionhttp://www.eas.asu.edu/~spanias/convolution_demo.htm

http://www.isip.msstate.edu/projects/speech/software/demonstrations/applets/util/convolution/current/