31
Convolution Computational Photography WS 07/08 Image Processing Basics Björn Bollensdorff – [email protected]

Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Embed Size (px)

Citation preview

Page 1: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Convolution

Computational Photography WS 07/08Image Processing Basics

Björn Bollensdorff – [email protected]

Page 2: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Overview

• Introduction (multiplication)• Discrete convolution• Continuous convolution• Properties• Filter• Excursion: frequency domain• 2D Convolution

Page 3: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiplication

• using a simpleroperation to generate ahigher order operation

• multiple summations• general formula

Introduction

Page 4: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Doing the same with functions

• Applying theoperations on eachvalue separated

• The result is afunction

Introduction

Page 5: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiplication and addition oftwo functions

f1+f2 f1• f2

Introduction

Page 6: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Convolution

• Operation that uses addition and multiplication• result is a function• It is a way to combine to functions• It is like weighting one function with the other• Flipping one function and then summing up the

products for each positions for a given offset n

Discrete Convolution

Page 7: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Flipping the function

f2(-k)

Discrete Convolution

Page 8: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

Discrete Convolution

Page 9: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

1•1 =1

Discrete Convolution

Page 10: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

1•3 + 2•1 =5

Discrete Convolution

Page 11: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

1•1 + 2•3 + 1•1 = 8

Discrete Convolution

Page 12: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

1•2 + 2•1 + 1•3 + 2•1 = 9

Discrete Convolution

Page 13: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

2•2 + 1•1 + 2•3 = 11

Discrete Convolution

Page 14: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

1•2 + 2•1 = 4

Discrete Convolution

Page 15: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

2•2 = 4

Discrete Convolution

Page 16: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Multiply and add

Discrete Convolution

Page 17: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Result

final length = length(f1(n)) + length(f2(n)) - 1

Discrete Convolution

Page 18: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

ComparisonCrosscorrelationConvolution

Discrete Convolution

Page 19: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Continuous Convolution

• Summation becomes an integral

Continuous Convolution

Page 20: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Properties

• Commutative

• Associative

• Distributive

Properties

Page 21: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Filter

• signal y(n) is aconvolution of u(n)with the Transferfunction h(n)

• Filtering can be doneby the convolution oftwo signals

Filter

Page 22: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Excursion Frequency Domain

• Another representation of the same signal• Shows of which frequencies the signal consists• Frequency in images represents the intensity

changes

Excursion

Discrete Fourier Transformation

Page 23: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Example Rectangle Function

• the rectanglefunction in thespatial domainbecomes a sinc in thefrequency domain

• two overlaid sincs

Excursion

Page 24: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Example Lena

picture 1 picture 2

Excursion

Page 25: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Convolution Theorem

Convolution in spatial domain becomesmultiplication in frequency domain

Fast convolution using FFT

Properties

Page 26: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Derivation of the theorem

Properties

Page 27: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

2D-Convolution

• We can do it in 2D too• usually one function is a small one and called

(convolution) kernel• sometimes only the cross correlation is used

2D-Convolution

Page 28: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

What should we do with theborder?

• different approaches• ignore them ⇒ image gets smaller• suppose they are black• mirror the border• suppose the image continuous with the

last pixels

2D-Convolution

Page 29: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Example finding edges

10-120-210-1

Differentiating to find the steep parts of the picture

121000-1-2-1

2D-Convolution

Page 30: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Example Simple NoiseReduction

• cutting of the high frequency noise by low passfiltering with a sinc like kernel

• for not changing the aspect of the image thesum of the kernel must be 1

111151111

1/13

2D-Convolution

Page 31: Convolution - TU · PDF file•Flipping one function and then summing up the ... multiplication in frequency domain Fast convolution using FFT Properties. Derivation of the theorem

Sources

• Noll, P. Script (1999) Signale und Systeme. TU Berlin• Noll, P. Script (WS 2006/7) Nachrichten Übertragung I TU

Berlin• Albiol, A., Naranjo, V., Prades J., Tratamiento digital de la

señal, teoría y aplicaciones. Universidad Politécnica deValencia

• Picture 1, 2:http://www.vis.ne.jp/mt/archives/000680.html

• Applet: http://www.jhu.edu/~signals/convolve/index.html• Proof:

http://mathworld.wolfram.com/ConvolutionTheorem.html

Sources