IMAGE PROCESSING (RRY5) THE CONTINUOUS D FOURIER TRANSFORM
INTRODUCTION A vital tool in image processing. Also a prototype of other image transforms, cosine, Wavelet etc. Applications Image Filtering - Smooth or sharpen images. Image Restoration - Remove distortions, such as blurring, image motion Image Classification - Distinguish different types of images Image Compression - Can be used but much better transforms available.
-D CONTINUOUS FOURIER TRANSFORMS Definition F(ν) = f(t)exp(πiνt)dt f(t) = F(ν)exp(+πiνt)dν Note forward and inverse transforms not the same, sign difference in integral. Other Definitions F(ω) = f(t)exp( iωt)dt or f(t) = π F(ω)exp(+iωt)dω F(ω) = π f(t)exp( iωt)dt f(t) = π F(ω)exp(+iωt)dω 3
FT has real and imaginary parts F(ν) = f(t)exp(πνit)dt Real[F(ν)] = f(t)cos(πνt)dt Imag[F(ν)] = f(t)sin(πνt)dt If f(t) is even (f(t) = f( t)) the imaginary part of transform Imag[F(ν)] = because sin(πνt) is an odd (antisymmetric) function. Likewise if f(t) is antisymmetric so (f(t) = f( t)) the real part of the transform Real[F(ν)] = because cos(πνt) is an even (symmetric) function. Define Fourier amplitude = Real[F(ν)] + Imag[F(ν)] and define Fourier Phase = tan (Imag[F(ν)]/Real[F(ν)]) 4
-D CONTINUOUS FOURIER TRANSFORMS F(u, v) = f(x, y)exp(πi(ux + vy))dxdy f(x, y) = F(u, v)exp(+πi(ux + vy))dudv where u,v are spatial frequencies. If the image has linear dimensions, e.g. centimetres. the u,v are in units of cycles/cm If image has angular dimensions (e.g degrees) then u,v are in cycles/degree. 5
From the definition to calculate D FT component at particular u,v multiply image f(x,y) by the complex kernel function exp(πi(ux + vy)) and integrate. the kernel has constant value on lines in the the u,v domain such that ux + vy = constant. The Kernel function is therefore like a corrugated roof with an orientation which depends on u,v and a wavelength / u + v. 6
D Fourier Transform has a separable kernel exp(πi(ux + vy)) = exp(πiux)exp(πivy) Therefore F(u, v) = f(x, y)exp(πi(ux + vy))dxdy = [ f(x, y)exp(πiux)dx ] exp(πivy)dy This property means we can do the FT of any object in two stages. First do a D transform of each row. f(x, y) f (u, y) Then do a D transform of all the columns of f (u, y) so. f (u, y) g(u, v) 7
Some input images are also separable into functions of x and y i.e. f(x, y) = f x (x)f y (y) In this special case only. F(u, v) = [ f x(x)exp(πiux)dx ] [ f y(y)exp(πivy)dy ] i.e. the FT is the product of the D FTs of f x (x) and f y (y) respectively. 8
FOURIER TRANSFORM PROPERTIES If f(x, y) is real (as images always are) then F(u, v) is Hermitian i.e. F( u, v) = F (u, v) where indicates complex conjugate If f(x, y) is also symmetric (i.e. f( x, y) = f(x, y) ) then F(u, v) is entirely real, i,e, the phase of F(u,v) is either or 8. 9
FOURIER TRANSFORMS PROPERTIES(cont) Inner Product f(x, y)g (x, y)dxdy = F(u, v)g (u, v)dudv if f(x, y) = g(x, y) and F(u, v) = G(u, v) then we obtain Parsevals thereoem. Scaling FT[f(ax, by)] = F(u/a, v/b) ab Shifting FT[f(x x o, y y o )] = F(u, v)exp(πi(ux o + vy o ))
D Delta Function Definition The delta function situated at x = x o, y = y o, called δ(x x o, y y o ) is defined in the limit as dx, dy go to zero below Function Value height = / (dx dy) xo x yo dx dy y δ (x-xo, y- yo) Is above function as dx and dy go to zero it therefore has value infinity at x=xo,y=yo and value zero elsewhere. The area under the function is. Figure :
SOME IMPORTANT D FOURIER TRANSFORMS Delta Function FT(δ(x x o, y y o ) = exp(πi(ux o + vy o )) Delta function at x=,y=.5 5 y 5 5 x 5 Real Part of FT Imaginary Part of FT 5 v 5 5 u 5 5 v 5 5 u 5 Figure :
Two Delta Functions FT(.5δ(x x o, y y o )+.5δ(x+x o, y+y o )) = cos(π(ux o +vy o )) Two Delta functions at x=+/,y=.5 5 y 5 5 x 5 Real Part of FT Imaginary Part of FT 5 v 5 5 u 5 5 v 5 5 u 5 Figure 3: 3
Sampling Function Defined as III x, y (x, y) = m= n= m= n= δ(x m x, y n y) FT(III x, y (x, y)) = III u, u (u, v) where u = / x and v = / y Sampling Function (Infinite Delta grid sep=).5.5 y x Real Part of FT (Infinite Delta grid Sep =) Img Part of FT.5.5 v u v u Figure 4: 4
Gaussian FT(exp( π(x + y )) = exp( π(u + v )) Gaussian Function.5 y x Real Part of FT Imaginary Part of FT.5 v u v u Figure 5: 5
Circular Top Hat Consider a function of x,y which is inside r = (x + y ) and outside. Its FT is circulary symmetric and depends oly on the radius in the u,v plane r u,v = (u + v ). The FT is related to a Bessel function of the first kind divided by r u,v. Circular Top Hat Function.5 5 y 5 5 x 5 Real Part of FT Imaginary Part of FT 4 5 v 5 5 u 5 5 v 5 5 u 5 Figure 6: 6
CONVOLUTION DEFINITION If g(x, y) = h(x, y) f(x, y) where indicates convolution then mathematically g(x, y) = h(x, y )f(x x, y y )dx dy = h(x x, y y )f(x, y )dx dy 7
VISUALIZING D CONVOLUTION y y x x f(x,y ) two delta functions h(x,y ) inside triangle, outside f(x,y )h(x x,y y ) y f(x,y )h(x x,y y ) y y x x y x x For this value of x,y shift of rotated second function, result of multiplication of two functions and integration is For this value of x,y shift of rotated second function, result of multiplicatio of two functions and integration is Figure 7: 8
y VISUALIZING D CONVOLUTION(cont) y x * x f(x,y ) two delta functions h(x,y ) inside triangle, outside g(x,y) y = x Do the operation on the previous sheet for every possible x,y and then build up point by point the g(x,y) function. Effect of convolution with delta functions is to make a copy of the triangle function centred on each of the deltas. Note in output triangles not rotated Figure 8: 9
CONVOLUTION THEOREM The convolution theorem will be used many times. If g,h and f functions are related by a convolution (see above) then their fourier transforms G(u, v), F(u, v) and H(u, v) are related, viz if Then g(x, y) = h(x, y) f(x, y) G(u, v) = H(u, v) F(u, v) It also follows that if in the spatial domain then in the Fourier domain g(x, y) = h(x, y) f(x, y) G(u, v) = H(u, v) F(u, v)
CORRELATION Exactly like convolution but with NO 8 degree rotation of second function, before shift multiplication and summation. DEFINITION If g(x, y) = h(x, y) f(x, y) where indicates cross-correlation then mathematically g(x, y) = h(x, y )f(x x, y y)dx dy unlike convolution the order matters, g(x, y) = f(x, y) h(x, y) is not the same output function where g(x, y) = f(x, y )h(x x, y y)dx dy In previous lecture have seen how correlation with various filters can be used to smooth, sharpen and find gradients of images. Can also be used to recognise objects in an image. Note get Autocorrelation if wto imput images are teh same.
CORRELATION THEOREM Similar to convolution if we Fourier transform an image which is the correlation of two input images, there is a simple relationship between this FT and the FT of the two original images. If g(x, y) = h(x, y) f(x, y) and we take the FT then G(u, v) = H(u, v) F (u, v) where the star indicates complex conjugate. In the case of autocorrelation, f =h amd F=H hence the FT of the autocorrelation of h(x,y) is everywhere real and positive and is called the power spectrum of h(x,y).