Download presentation
Presentation is loading. Please wait.
1
1D and 2D signal processing
Convolution 1D and 2D signal processing
2
Convolution Theorem Let F and H be the Fourier transforms of f and h
For big filters, can be faster to convert to fourier domain, then multiply, then convert back Let F and H be the Fourier transforms of f and h Convolution in the spatial (image) domain is equivalent to multiplication in the frequency (Fourier) domain
3
Symmetric theorem: Convolution in the frequency domain is equivalent to multiplication in the spatial domain
4
2-D Convolution thm f(x,y) h(x,y) g(x,y) * |F(sx,sy)| |H(sx,sy)|
|G(sx,sy)|
5
Consider the delta function
6
Time-shift delta
7
Sample the input (it’s a convolution!)
8
What is the spectrum?
9
Fourier Coefficients
10
CTFT
11
Euler’s identity
12
Sine-cos Rep
13
Harmonic Analysis
14
Convolution=time-shift&multi
15
Convolution Thm multiplication in the time domain =
convolution in the frequency domain
16
Sample
17
Spectrum reproduced spectrum to be reproduced at intervals
18
Summary
19
Example of 1D convoln
20
2D Convolution
21
2D Convolution
22
Region of Support The region of support is defined as that area of the .kernel which is non-zero linear convolution:=signal has infinite extent but kernel has finite support If function has finite region of support we have compact support
23
Real images have finite region of support
But we treat them as periodic and infinite! We repeat kernels so that they have the same period as the images. We call this cyclic convolution.
24
Convolution in 2D
25
Avoid the Mod op
26
What is wrong with avoiding the mod op?
How do I find the center of the kernel?
27
Cyclic Convolution
28
Implementing Convolution
for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { sum = 0.0; for(int v = -vc; v <= vc; v++) for(int u = -uc; u <= uc; u++) sum += f[cx(x-u) ][cy(y-v)] * k[ u+uc][v+vc]; if (sum < 0) sum = 0; if (sum > 255) sum = 255; h[x][y] = (short)sum; }
29
What happens to the image if you ignore the wrap?
30
Cyclic Convolution keeps the edges
31
Can you think of a better way to implement convolution?
Keep the edges! Don’t use the mod operation. How about growing the image by the size of the kernel*2?
32
Convolution is slow, how can I speed it up?
JAI! FFT!? Other ideas?
33
But JAI… Eats my edges! Devised j2d Border Implement that using MDI!
34
For HW Integrate the BorderFrame in j2d.border into the MDI interface so that you can apply the BorderPanel to the input image. Use the RunSpinnerSlider to dynamic alter the parameters. Update the image dynamically Apply the change with an apply button.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.