CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-1 Fourier Trnsform full escription of the istribution of sptil frequencies in n imge is given by the twoimensionl Fourier trnsform of the imge. To begin consier the imge in Figure 2.14. The entire imge my be represente by function f(,y). single, horizontl line of the imge t y= is then f(,), one imensionl function illustrte in Figure 2.14b. f(,) is perioic function squre wve with perio n sptil frequency 1/ which in this cse represents the chnge in brightness of the imge long the selecte line. Figure 2.14 is very simple emple of the eistence of perioic function in n imge contet. Figure 2.14: Illustrtion of sptil frequency in imge t. ) originl imge, f(,y), b) plot of f() for the trnsect cross imge t the rrow. Perioic functions Perioic functions re etremely importnt throughout mth, physics n engineering n hve very wie rnge of pplictions. It is prticulrly convenient mthemticlly if the perioic functions re smooth, continuous n continuously ifferentible. The squre wve, of course, is neither smooth, nor continuous nor continuously ifferentible. Fourier propose tht ny perioic function coul be represente ectly by n infinite series of sine n/or cosine functions with pproprite mplitues, phses n frequencies. Since sines n cosines re mthemticlly convenient it is ctully esier to mnipulte n infinite series of these functions thn it is to el irectly with the squre wve. This pproch will le to methos of trnsforming n mnipulting perioic functions tht woul be very ifficult in the originl form. Let the squre wve hve n mplitue of 1, men vlue of 0 n sptil perio or wvelength = (sptil frequency, k=1/). s first pproimtion, one might choose to represent the squre wve with sine wve of the sme frequency n phse s the squre wve (Figure 2.15). The mplitue of this sine wve is somewht lrger thn tht of the originl squre wve, but the mens re equl. n lterntive representtion of the sine function is shown in Figure 2.15b, where the verticl brs represent specific sptil frequencies, n the height of the brs represents the mplitue of those frequencies. In this cse there re two frequencies, k=0 n k=1/. When k=0 the sptil perio is infinite, i.e., there is no sptil vrition. The mplitue of the br t k=0 in Figure 2.15b represents the verge vlue of the
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-2 squre wve, /2. The mplitue of the component t k=1/ represents the mimum mplitue of the sine wve t tht frequency, 2/π. 0 + f() = 0 + 1 sin 0-0 / 0 1/ 3/ 5/ 7/ 7/ 9/ k Figure 2.15: First orer pproimtion of squre wve with sine function. ) sptil representtion b) frequency representtion ccoring to Fourier's theory, one my improve consierbly upon this initil pproimtion by ing selecte sine wves of progressively higher frequencies n pproprite mplitues. In this prticulr cse, sine wve with twice the initil (or funmentl) frequency will not improve the pproimtion, but the ition of sine wve with three times the frequency n 1/3 the mplitue of the funmentl will improve it. This is illustrte in Figure 2.16 in which the new component is represente by she line n the soli line represents the composite pproimtion given by: f ( ) = 0 + 1 sin ( ) + 1 3 sin ( 3 ) (2.9) where = 2λ/ Notice tht the ition of the higher frequency reuces the pek mplitue n steepens the slopes of the composite t = n (n=0,1,2,3,...) in Figure 2.16b. s before, n lterntive grphicl representtion in terms of sptil frequencies is given in Figure 2.16b. 0 + 1 f() = 0 + 1 sin (2π/) + 1 / 3 sin(3) 1 0 0-1 0 /2 0 1 3 k 1/ 3/ 5/ 7/ 7/ 9/ Figure 2.16: Secon orer pproimtion of squre wve with sine functions. ) sptil representtion; b) frequency representtion
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-3 The net term in the Fourier series is sine wve with 5 times the frequency n 1/5 the mplitue of the funmentl term. This new term is illustrte with she line in Figure 2.17. The sum of ll the components (the soli line) is now given by: f ( ) = 0 + 1 sin ( ) + f() = 0 + 1 [sin () + 1/3 sin (3) +1/5 sin (5)] 0 + 0-0 0 /2 1 3 sin ( 3 ) + 1 5 sin ( 5 ) (2.10) 1 1 1 3 5 k 0 1/ 3/ 5/ 7/ 7/ 9/ Figure 2.17: Thir orer pproimtion of squre wve with sine functions. ) sptil representtion b) frequency representtion With only four terms in the series constnt n three perioic terms one cn begin to visulize squre wve. s more terms re e the slopes t =n (n=0,1,2,3,...) will become incresingly steep n the slopes elsewhere will become more n more shllow. The full Fourier series for squre wve contins n infinite number of terms: o+ 1 f (, ) = sin () + 1 3 sin (3 ) + 1 5 sin (5 ) + 1 7 sin (7 ) + (2.11) or, more precisely, f(,) = o+ Σ B n sin ( n ) n=1 where: m = 1,3,5,... = 2π/ (2.12) B n = 1 n The infinite series is complete n ect representtion of the originl squre wve. On the other hn, since the full series is necessry to ectly replicte the very shrp eges of the squre wve; nything less will introuce errors t the eges.
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-4 Simple imge ptterns The nlysis presente bove ws concerne with the sptil vribility in one imension. The sme principles pply to full, two-imensionl imge. Consier simple imge of lternting blck n white brs of equl with (Figure 2.18). The two-imensionl Fourier trnsform of this imge is shown in Figure 2.18b. In the two-imensionl trnsform the loction of ech spot represents specific sptil frequency n the brightness of the spot represents the mplitue of tht frequency component. Since it is ifficult to reprouce wie rnge of gry levels in the figures presente here, the size of the spot is use to represent the mplitue. y k y k 5 Figure 2.18: n illustrtion of simple sptil frequency (squre wve) in sptil () n frequency (b) omins. Since there re 7/ cycles t the Nyquist frequency, k N, there must be 14 smples per sptil perio,, in the originl imge. b It is tritionl to locte the zero-frequency (origin) t the center of the trnsform imge with the frequency incresing rilly outwr to the ege of the imge. The ege of the trnsform imge is equivlent to the Nyquist frequency. The orienttion of ech spot reltive to the center point n either the k or k y is enotes the irection of tht sptil frequency in the originl imge. In Figure 2.18b, spots occur only long the k -is since the sptil frequencies in the originl imge re ll in the -irection. This series of spots represents the Fourier series, ech spot enoting one term of the series. The centrl spot is, of course, the zero-frequency term enoting the men mplitue of the imge. If the br pttern hs sptil perio,, the spot t k =1/ represents the coefficient of the first term in the series, B=2/π. The secon term in the series occurs t k =3/ with B=2/3π. Note tht the spcing of the ots in Figure 2.18b is ienticl to the spcing of the brs in Figure 2.17b. long ny other irection pssing through the origin (Figure 2.18b) there re no spots, ecept, of course, t the center. This is becuse the only consistent sptil frequency in the originl imge (Figure 2.18) is long the k irection. long ll other irections in the originl imge either the sptil frequencies re ectly zero (long ny verticl line) or they cncel becuse of the continuous shift in phse over the imge (long ny igonl). Fourier trnsforms re invertible, i.e., the originl imge my be reconstructe from its trnsform. Just s in the one-imensionl emple, ll components of the Fourier series woul 7 5 3 1 0 k = 0.5 cycles / N
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-5 hve to be inclue if the reconstruction were to be ect. With very few eceptions, the full Fourier series representtion of n imge will contin n infinite number of terms. In the cse of the perioic br pttern in Figure 2.18, the trnsform imge woul hve to be infinite in the k - irection to be n ect representtion of the originl imge. s shown, however, the trnsform contins only four terms beyon the zero-frequency term which contribute to the series. These terms correspon to the coefficients B 1, B 2, B 3 n B 4. reconstruction of the br imge from the trnsform shown woul not be perfect. In fct, the reconstruction woul be only slightly better thn tht illustrte in Figure 2.17, reconstruction for the one-imensionl cse using only three sinusoil terms. The highest frequency in the trnsform imge (Figure 2.18b) is one which is seven times the sptil frequency of the br pttern in the originl imge, tht is, the Nyquist frequency, k, is 7/. To put it nother wy, the trnsform bounry is ssocite with the smpling intervl. In orer for 7/ to be the highest frequency contine in the trnsform there must be 14 smples per sptil perio,. Thus, the smpling intervl for the originl imge in the -irection is s =/14. Just s there is high frequency limit to the imge, there is lso low frequency limit which is efine by the fiel of view (FOV) of the imge. For emple, if n imge were cquire of scene represente by Figure 2.18 n the imge FOV ws less thn, the ctul sptil frequency of the scene coul not be etermine from the imge. The reltionship of the sptil n frequency omins for low frequency is ienticl to tht of the high frequency, i.e., the imge FOV must spn t lest one full cycle of the sptil frequency if tht sptil frequency is to be istinguishble in the imge. Thus, the lowest etectble sptil frequency, k, is ectly the FOV of the imge: k = 1/FOV (2.13) chnge it the irection n perio of the sptil feture results in n equivlent chnge in the orienttion n spcing of the sptil frequencies. In Figure 2.19, the smple size,, is ¼ of the sptil perio,, n the sptil perio is in the verticl irection. The sptil frequencies lso occur only in the verticl irection n the spcing hs chnge, reflecting the chnge in the sptil frequency. The spots now occur t frequencies 1/ n 2/. The frequency 2/ is necessry becuse the with of the bright lines is now only ¼ of the sptil perio. The line with is lso equl to the smple size. Thus, t the Nyquist frequency there re 4 smples per sptil perio. The generl reltionships between the sptil n frequency omins re illustrte in Figure 2.20.
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-6 y k y 5 1 k / b Figure 1.9: n illustrtion of simple sptil frequency (squre wve) in sptil () n frequency (b) omins. Since there re 2/ cycles t the Nyquist frequency, k N, there must be 4 smples per sptil perio,, in the originl imge (s y = /4). 2 k = 0.5 cycles / N FOV y s y The smpling intervl efines the Nyquist frequency the high frequency limit of the imging system: s k N = 1/2s k Ny = 1/2s y FOV originl imge The ege of the Fourier trnsform imge represents the Nyquist frequency. The highest frequency is long the igonl: k Ny high frequency k oy k o low frequency k Nm = k N 2 + k Ny 2 The low frequency "resolution limit is relte to the imge FOV: k o = 1 FOV k N k oy = 1 FOV y k Nm Fourier trnsform Figure 2.20 Reltionships between the sptil & frequency omins.
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-7 Non-perioic functions Reltively few imges ehibit clerly perioic fetures like those in the previous emples. Fortuntely, Fourier nlysis my be etene to non-perioic functions. Consier function for which the pulse with,, is less thn ½ the sptil perio,. It shoul be cler from n emintion of Figures 2.15, 2.16 n 2.17 tht the series which gve rise to the squre wve with =0.5 will require some ltertion in orer to represent the sme sptil frequency but with <0.5. If the pulse with is only ¼ of the sptil perio (=0.25), then twice the number of terms is neee in the Fourier series thn for the cse of =0.5 to equtely escribe the perioic function. The trnsform imge for this cse is illustrte in Figure 2.19. s the rtio of the pulse with to sptil perio ecreses, the number of frequencies neee to escribe the function increses (Figure 2.21,b,c) until, when the rtio pproches zero (==> ), the function is effectively non-perioic n ll possible frequencies re require not just the iscrete frequencies consiere erlier (Figure 2.21). For non-perioic functions, the infinite series (Eqution 2.12) becomes n infinite integrl of the form: where: n: i = 1 i2πk F(k ) f () e = (2.14) ep [-i2πk ] = cos (2πk ) - i [sin(2πk )] The Fourier trnsform is frequently epresse in terms of its rel n imginry prts: f () cos(2 k ) (2.15) Re[F] = π f () sin(2 k ) (2.15b) Im[F] = π In some cses it is more useful to escribe the trnsform in terms of its mplitue (or moulus) n phse: moulus = phse = 2 2 m[f] = Re [F] + Im [F] (2.16) = FF * 1 Im[F] Ph[F] = tn Re[F] where F * is the comple conjugte of F. The trnsform is completely escribe by either the mplitue n phse or by the rel n imginry prts. (2.16b)
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-8 Imge Qulity Resolution hs been efine in terms of the bility of n imging system to represent the higher sptil frequencies etnt in the originl scene. Tritionlly, the high frequency limit ws the primry mesure of the qulity of the imging system. Such criterion woul men tht the (sptil) qulity of igitl imge woul be quite unrelistic, epening s it woul only on the smpling intervl n not ccounting for ny of the etils of the response of the opticl system. It woul be nlogous to evluting soun system strictly on its high-frequency cutoff rther thn consiering the systems response to ll coustic frequencies within its rnge. The opticl systems which form the imge to be igitize re limite by iffrction effects n vrious berrtions. Opticl egrtion is pprent in the blurring n smering of the imge of point source (impulse function). The function escribing the smere istribution in the imge plne is clle the point spre function (PSF) n is illustrte in Figure 2.22. The overll response of the opticl system s it vries over lrge rnge of sptil frequencies cn be chrcterize by the contrst or moultion prmeter, efine s: mo ultion = I I m m I + I min min (2.17) where I m n I min re the mimum n minimum irrinces. Figure 2.23 is plot of imge moultion versus sptil frequency for two hypotheticl lens systems. Lens system 2 hs higher frequency cut-off thn lens system 1 byte the response of lens system 2 is generlly better over its more limite rnge. If the smpling-efine cutoff of the igitizing system is t k, then lens system 2 woul be preferble to lens system 1 since its response is much better over the limite sptil frequency rnge llowe by the smpling. more forml n complete escription of the frequency response of n opticl system is given by the opticl trnsfer function (OTF) which is the Fourier trnsform of the point spre function (PSF). The moulus of the OTF is clle the moultion trnsfer function (MTF); the phse is clle the phse trnsfer function (PTF). It is the MTF which is generlly use to escribe the frequency response of the opticl system. Similr to the moultion prmeter, it is mesure of the reuction of contrst from object to imge over the frequency spectrum. The PTF escribes the relte phse shifts n is usully of less interest thn the MTF. References Cstlemn, K.R. (1979) Digitl Imge Processing. Prentice-Hll, Inc., Englewoo Cliffs, N.J.
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-9 = 1/ 2/ 3/ 4/ 5/ 6/ 7/ b = 1/ 2/ 3/ 4/ 5/ 6/ 7/ c =/ 1/ 2/ 3/ 4/ 5/ 6/ 7/ ==> 1/ 2/ 3/ 4/ 5/ 6/ 7/ Figure 2.21 s the rtio of the pulse with to sptil perio ecreses, the number of frequencies neee to escribe the function increses (Figure 2.21,b,c) until, when the rtio pproches zero (==> ), the function is effectively non-perioic n ll possible frequencies re require, not just the iscrete frequencies consiere erlier (Figure 2.21).
CEE 615: DIGITL IMGE PROCESSING Topic 2: The Digitl Imge 2-10 Figure 2.22 The point-spre function: the function escribing the smere istribution in the imge plne is clle the point spre function (PSF). Figure 2.23. Plot of imge moultion versus sptil frequency for two hypotheticl lens systems. Lens system 2 hs higher frequency cut-off thn lens system 1 but the response of lens system 2 is generlly better over its more limite rnge. If the smpling-efine cutoff of the igitizing system is t k N, then lens system 2 woul be preferble to lens system 1 since its response is much better over the limite sptil frequency rnge llowe by the smpling.