Introduction to th Fourir transform Computr Vision & Digital Imag Procssing Fourir Transform Lt f(x) b a continuous function of a ral variabl x Th Fourir transform of f(x), dnotd by I {f(x)} is givn by: I{ f ( x)} f ( x)xp[ jπux whr j Givn, f(x) can b obtaind by using th invrs Fourir transform: I { } f ( x) xp[ jπux du. + Dr. D. J. Jackson Lctur 8- Dr. D. J. Jackson Lctur 8- Ths two quations, calld th Fourir transform pair, xist if f(x) is continuous and intgrabl and is intgrabl. Ths conditions ar almost always satisfid in practic. W ar concrnd with functions f(x) which ar ral, howvr th Fourir transform of a ral function is, gnrally, complx. So, F ( R( + ji ( whr R( and I( dnot th ral and imaginary componnts of rspctivly. Exprssd in xponntial form, is: whr F ( R ( + I ( ϕ( tan I( R( jϕ ( Th magnitud function is calld th Fourir spctrum of f(x) ϕ( is th phas angl. Dr. D. J. Jackson Lctur 8-3 Dr. D. J. Jackson Lctur 8- Th squar of th spctrum, P( R ( + I ( is commonly calld th powr spctrum (or th spctral dnsit of f(x). Th variabl u is oftn calld th frquncy variabl. This nam ariss from th xprssion of th xponntial trm xp[-jπux in trms of sins and cosins (from Eulr s formula): Intrprting th intgral in th Fourir transform quation as a limit summation of discrt trms mak it obvious that: is composd of an infinit sum of sin and cosin trms. Each valu of u dtrmins th frquncy of its corrsponding sin-cosin pair. xp[ jπux cos(πux) j sin(πux) Dr. D. J. Jackson Lctur 8-5 Dr. D. J. Jackson Lctur 8-6
Fourir transform xampl Considr th following simpl function. Th Fourir transform is: f(x) X x X f ( x)xp[ jπux xp[ jπux [ jπu [ jπu j πux jπux sin( πux ) πu X [ jπu jπux jπux jπux j πux Fourir transform xampl (continud) This is a complx function. Th Fourir spctrum is: sin( πux) πu sin( πux) X ( πux) jπux plot of looks lik th following: Dr. D. J. Jackson Lctur 8-7 Dr. D. J. Jackson Lctur 8-8 Th -D Fourir transform Th Fourir transform can b xtd to dimnsions: I{ } th invrs transform I { } xp[ jπ ( ux + v dy. xp[ jπ ( ux + v dudv. Th -D Fourir transform (continud) Th -D Fourir spctrum is: F ( R ( + I ( Th phas angl is: ϕ( tan Th powr spctrum is: I( R( P( R ( + I ( Dr. D. J. Jackson Lctur 8-9 Dr. D. J. Jackson Lctur 8- Sampl -D function and its Fourir spctrum Exampl -D Fourir transform X xp[ jπ ( ux + v dy xp[ jπux xp[ jπvy dy j πux j πvy X Y [ [ jπu jπv [ jπu jπux sin( πux ) XY[ ( πux ) Y [ jπy jπux j πvy sin( πvy) [ ( πvy) sin( πux ) sin( πvy) Th spctrum is XY[ [ ( πux ) ( πvy) jπvy Dr. D. J. Jackson Lctur 8- Dr. D. J. Jackson Lctur 8-
Exampl -D functions and thir spctra Th discrt Fourir transform Suppos a continuous function, f(x), is discrtizd into a squnc {f(x ), f(x +Δx), f(x +Δx),.., f(x +[-Δx)} by taking sampls Δx units apart Lt x rfr to ithr a continuous or discrt valu by saying f ( x) f ( x + xδx) whr x assums th discrt valus,,, - and {f(),f(),,f(-)} dnots any uniformly spacd sampls from a corrsponding continuous function Dr. D. J. Jackson Lctur 8-3 Dr. D. J. Jackson Lctur 8- Sampling a continuous function Th discrt Fourir transform pair Th discrt Fourir transform is givn by: f ( x)xp[ jπux / x for u,,,- Th discrt invrs Fourir transform is givn by: f ( x) xp[ jπux / u for x,,,- Th valus of u,,,-in th discrt cas corrspond to sampls of th continuous transform at, Δ Δ, (- )Δu Δu and Δx ar rlatd by Δu/( Δx) Dr. D. J. Jackson Lctur 8-5 Dr. D. J. Jackson Lctur 8-6 Th -D discrt Fourir transform In th -D cas: M M x y for u M- and v - M u v xp[ jπ ( ux / M + vy / ) xp[ jπ ( ux / M + vy / ) for x M- and y - Th discrt function f(x, rprsnts sampls of th continuous function at f(x +xδx, y +yδ Δu/(MΔx) and Δv/(Δ Th -D discrt Fourir transform (continud) For th cas whn M (such as in a squar imag) x y u v xp[ jπ ( ux + v / xp[ jπ ( ux + v / ot ach xprssion in this cas has a / trm. Th grouping of ths constant multiplir trms in th Fourir transform pair is arbitrary. Dr. D. J. Jackson Lctur 8-7 Dr. D. J. Jackson Lctur 8-8
Discrt Fourir transform xampl Discrt Fourir transform xampl (continud) Th four corrsponding Fourir transform trms ar 3 ) f ( x)xp[ x [ f () + f () + f () + f (3) [ + 3+ + 3.5 3 ) f ( x)xp[ jπ / x jπ / jπ [ + 3 + + [ + j j3π / Considr sampling at x.5, x.75, x., and x 3.5 Hr Δx.5 and x rangs from 3 F ( ) [ + j F ( 3) [ + j Dr. D. J. Jackson Lctur 8-9 Dr. D. J. Jackson Lctur 8- Discrt Fourir transform xampl (continud) Th Fourir spctrum is thn ) 3.5 ) [( / ) + (/ ) ) [(/ ) + ( / ) 3) [( / ) + (/ ) / / / 5 5 Proprtis of th -D Fourir transform Th dynamic rang of th Fourir spctra is gnrally highr than can b displayd common tchniqu is to display th function [ ) D ( c log + v whr c is a scaling factor and th logarithm function prforms a comprssion of th data c is usually chosn to scal th data into th rang of th display dvic, [-55 typically ([-56 for 56 gray-lvl MTLB imag) Dr. D. J. Jackson Lctur 8- Dr. D. J. Jackson Lctur 8- Sparability Sparability (continud) Th discrt transform pair can b writtn in sparabl forms x for v,,,- xp[ jπux / u xp[ jπux / for x,y,,,- So, or f(x, can b obtaind in stps by succssiv applications of th -D Fourir transform or its invrs. y v xp[ jπvy / xp[ jπvy / Th -D transform can b xprssd as f(x, x x, xp[ jπux / whr x, xp[ jπvy / y Graphically, th procss is as follows,,-,,-,,- Row transforms Multiply by x, Column transforms -, -, -, Dr. D. J. Jackson Lctur 8-3 Dr. D. J. Jackson Lctur 8-
Translation Th translation proprtis of th Fourir transform pair ar xp[ jπ ( ux + v / u v f ( x x, y xp[ jπ ( ux + v / whr th doubl arrow indicats a corrspondnc btwn a function and its Fourir transform (or vic vrsa) Multiplying f(x, by th xponntial and taking th transform rsults in a shift of th origin of th frquncy plan to th point (u,v ). Translation (continud) For our purposs, u v /. Thrfor, xp[ jπ ( u x + v / jπ ( x+ ( ) x+ y x+ y ( ) u /, v / ) So, th origin of th Fourir transform of f(x, can b movd to th cntr of th corrsponding x simply by multiplying f(x, by (-) x+y bfor taking th transform ot: This dos not affct th magnitud of th Fourir transform Dr. D. J. Jackson Lctur 8-5 Dr. D. J. Jackson Lctur 8-6 Matlab xampl Matlab xampl (continud) %Crat data for th tst fzros(8); for x:6 for y:6 f(x,8; % Prform a translation shift on f(x, for x:8 for y:8 f(x,f(x,*((-)^(x+); % Comput th -D discrt Fourir transform Ffft(f); % Comput th Fourir spctrum Fspctsqrt(ral(F).^+imag(F).^); % Construct a scaling factor basd on % th dynamic rang of th spctrum FspctMXmax(max(Fspct)); % Comput D, th scald data D(56/(log(+FspctMX)))*log(+Fspct); figur(); % Plot, as an imag, a subst of D imag(d(56:7,56:7));colormap(gray(56)); Dr. D. J. Jackson Lctur 8-7 Dr. D. J. Jackson Lctur 8-8 Exampl imag and complt, scald Fourir spctrum plot Exampl imag and partial, scald Fourir spctrum plot (with shiftd f(x,) Dr. D. J. Jackson Lctur 8-9 Dr. D. J. Jackson Lctur 8-3