Fourier Transforms 1D 3D Image Processing Alireza Ghane 1
Overview Recap Intuitions Function representations shift-invariant spaces linear, time-invariant (LTI) systems complex numbers Fourier Transforms Transform pairs properties Convolution Theorem Understanding sampling in the Fourier space 2
What is a (digital) image? An image is made of pixels (=picture elements) the coordinate values are discretized Laurent Condat / Torsten Möller 3
Quantization The pixel values are quantized: they belong to a discrete set of values, generally represented by integers between 0 and N-1 coded on 8 bits 255 possible val. coded on 4 bits Laurent Condat / Torsten Möller coded on 2 bits 4 possible val. 4
2D lattices An image is defined on a lattice. The most common is the Cartesian (a.k.a square) lattice. But other lattices exist and have interesting properties. Laurent Condat / Torsten Möller 5
Image quality Common defaults in images: blur (motion blur, out of focus blur...) ringing aliasing (staircasing, Moiré patterns) Laurent Condat / Torsten Möller 6
Image quality Low-frequency Moiré artifacts appear when high-frequency content is sampled in an incorrect way. Laurent Condat / Torsten Möller 7
Image quality We need to be able to measure the difference between two images, for instance an original image and a degraded one. Classical difference measures between two images I 1 and I 2 : mean absolute error: MAE = 1 P W P H WH k x =1 k y =1 I 1[k x,k y ] I 2 [k x,k y ] mean square error: MSE = 1 P W P H WH k x =1 k y =1 I 1[k x,k y ] I 2 [k x,k y ] 2 255 2 peak signal to noise ratio (db): PSNR = 10 log 10 MSE There exist much more sophisticated quality measures and difference measures for images (SSIM...) Laurent Condat / Torsten Möller 8
Image enhancement Intensity Transformations image negatives log transforms gamma (power-law) transforms contrast stretching intensity-level slicing bit-plane slicing 9
Histogram equalization Idea -- stretch histogram non-uniformally such that final histogram is a uniform distribution p s (s) =p r (r) dr ds s = T (r) = Z r 0 p r (w)dw 10
Histogram matching original matched equalization 11
Local histogram equalization 12
Mechanics of filtering Correlation: w(x, y)? f(x, y) = ax bx w(s, t) f(x + s, y + t) Convolution: w(x, y) f(x, y) = s= a ax t= b bx w(s, t) f(x s, y t) s= a t= b 13
Median filtering (denoising) 14
Sharpening enhance / highlight transition in intensity how to find transition? unsharp masking / highboost filtering first / second order derivatives in 1D multi-d: gradient magnitude Laplacian 15
Overview Recap Intuitions Function representations shift-invariant spaces linear, time-invariant (LTI) systems complex numbers Fourier Transforms Transform pairs properties Convolution Theorem Understanding sampling in the Fourier space 16
Basis Vectors P P =3i +2j j b a P =1.6a +1.9b 0 i Alireza Ghane 17
Basis Vectors Linear combination of the basis vectors can express any point in the point space [grey rectangle]. P P =3i +2j j b a P =1.6a +1.9b 0 i Alireza Ghane 18
Basis Functions Linear combination of the basis functions can express any function in a the function space (subset of the functions world). Example: v k (t) = 1 t = k 0 otherwise 0 k f(t) = X k2r f(t k )v k (t) Alireza Ghane 19
Time vs. Frequency Space y = sin(2 100t) Y (f) ={ (f == ±100Hz)?1:0} y = sin(2 800t) Y (f) ={ (f == ±800Hz)?1:0} y = sin(2 100t)+sin(2 800t) Y (f) ={ (f == ±100Hz ±800Hz)?1:0} Alireza Ghane 20
Time vs. Frequency Space y = sin(2 100t) Y (f) ={ (f == ±100Hz)?1:0} y = sin(2 1t) Y (f) ={ (f == ±1Hz)?1:0} y = sin(2 1t) sin(1 100t) Y (f) ={ (f == ±99Hz ±101Hz)?1:0} y =0.5[cos(2 99t) cos(2 101t)] Alireza Ghane 21
Building Square Wave + + + + Alireza Ghane 22
Overview Recap Intuitions Function representations shift-invariant spaces linear, time-invariant (LTI) systems complex numbers Fourier Transforms Transform pairs properties Convolution Theorem Understanding sampling in the Fourier space 23
How to represent a function? on a computer, can only store a bunch of numbers, not a continuous function! brute-force idea: sampling 24
What is sampling? (mathematically speaking) modelled through an impulse not really a function, but a distribution: Z 1 1 (t) = 1 if t =0 (t)dt =1 0 if t 6= 0 25
The sifting property picking a value off from f: more general: Z 1 1 Z 1 1 f(t) (t)dt = f(0) f(t) (t t 0 )dt = f(t 0 ) 26
The impulse train pick up multiple values of f at once: s T (t) = 1X 1 (t n T ) 27
What is sampling? f(t) s T (t) = 1X f(n T ) (t n T ) 1 1X 1 f[n] (t n T ) 28