Source Code Domain Frekuensi

Embed Size (px)

Citation preview

  • 7/23/2019 Source Code Domain Frekuensi

    1/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    COMPUTER GRAPHICS&

    IMAGE PROCESSING

    LAB MANUAL 6

    PREPARED BY:: ENGR. ALI JAVED

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    2/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    IMAGE FILTERING IN FREQUENCY DOMAIN

    LAB OBJECTIVE:

    The objective of this !b is to "#$e%st!#$ & i'(e'e#t

    )* I'!+e e#h!#ce'e#t i# f%e"e#c- $o'!i#*

    .* Lo/ 0!ss Fite%s

    G!"ssi!# o/ (!ss fite%

    1"tte%/o%th o/ (!ss fite%

    I$e! o/ (!ss fite%

    2* Hi+h 0!ss Fite%s

    G!"ssi!# hi+h (!ss fite%

    1"tte%/o%th hi+h (!ss fite%

    I$e! hi+h (!ss fite%

    BACKGROUND MATERIAL:

    Dis!"#" F$%!i"! T!'s($!)

    W*# is #*" Dis!"#" F$%!i"! T!'s($!)+

    The +e#e%! i$e! is th!t the i'!+e 3f(x,y)of si4e M 5N6 /i be %e(%ese#te$ i# the f%e"e#c- $o'!i#3F(u,v)6* The e"!tio# fo% the t/o7$i'e#sio#! $isc%ete Fo"%ie% t%!#sfo%' 3DFT6 is8

    The co#ce(t behi#$ the Fo"%ie% t%!#sfo%' is th!t !#- /!vefo%' th!t c!# be co#st%"cte$ "si#+ ! s"' ofsi#e !#$ cosi#e /!ves of $iffe%e#t f%e"e#cies* The e5(o#e#ti! i# the !bove fo%'"! c!# be e5(!#$e$i#to si#es !#$ cosi#es /ith the v!%i!bes u!#$ v$ete%'i#i#+ these f%e"e#cies*

    The i#ve%se of the !bove $isc%ete Fo"%ie% t%!#sfo%' is +ive# b- the foo/i#+ e"!tio#8

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    3/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    Th"s, if /e h!ve F(u,v), /e c!# obt!i# the co%%es(o#$i#+ i'!+e 3f(x,y)6 "si#+ the i#ve%se, $isc%eteFo"%ie% t%!#sfo%'*

    Thi#+s to #ote !bo"t the $isc%ete Fo"%ie% t%!#sfo%' !%e the foo/i#+8

    the v!"e of the t%!#sfo%' !t the o%i+i# of the f%e"e#c- $o'!i#, !t F(0,0), is c!e$ the $c

    co'(o#e#to F(0,0)is e"! to MNti'es the !ve%!+e v!"e of f(x,y)

    o i# 9ATLA1, F(0,0)is !ct"!- F(1,1)bec!"se !%%!- i#$ices i# 9ATLA1 st!%t !t ) %!the%

    th!# :

    the v!"es of the Fo"%ie% t%!#sfo%' !%e co'(e5, 'e!#i#+ the- h!ve %e! !#$ i'!+i#!%- (!%ts*

    The i'!+i#!%- (!%ts !%e %e(%ese#te$ b- i, /hich is the s"!%e %oot of 7)

    /e vis"!- !#!-4e ! Fo"%ie% t%!#sfo%' b- co'("ti#+ ! F$%!i"! s,"#!%)3the '!+#it"$e of

    F(u,v)6 !#$ $is(!- it !s !# i'!+e*

    o the Fo"%ie% s(ect%"' is s-''et%ic !bo"t the o%i+i#

    the f!st Fo"%ie% t%!#sfo%' 3FFT6 is ! f!st !+o%ith' fo% co'("ti#+ the $isc%ete Fo"%ie%

    t%!#sfo%'*

    9ATLA1 h!s th%ee f"#ctio#s to co'("te the DFT8

    1. fft 7fo% o#e $i'e#sio# 3"sef" fo% !"$io6

    2. fft. 7fo% t/o $i'e#sio#s 3"sef" fo% i'!+es6

    3. fft# 7fo% # $i'e#sio#s 9ATLA1 h!s th%ee f"#ctio#s th!t co'("te the i#ve%se DFT8

    1. ifft

    2. ifft.

    3. ifft#

    H$- $"s #*" Dis!"#" F$%!i"! T!'s($!) !"/#" #$ S,#i/ D$)i' Fi/#"!i'0

    The foo/i#+ co#vo"tio# theo%e' sho/s !# i#te%esti#+ %e!tio#shi( bet/ee# the s(!ti! $o'!i# !#$f%e"e#c- $o'!i#8

    !#$, co#ve%se-,

    the s-'bo ;

  • 7/23/2019 Source Code Domain Frekuensi

    4/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    Bsi S#",s i' DFT Fi/#"!i'0

    The foo/i#+ s"''!%i4e the b!sic ste(s i# DFT Fite%i#+

    )* Obt!i# the (!$$i#+ (!%!'ete%s "si#+ f"#ctio# (!$$e$si4e80=>(!$$e$si4e3si4e3f66?

    .* Obt!i# the Fo"%ie% t%!#sfo%' /ith (!$$i#+8F>fft.3f, 0=3)6, 0=3.66?

    2* Ge#e%!te ! fite% f"#ctio#, H, of si4e 0=3)6 5 0=3.6****@* 9"ti(- the t%!#sfo%' b- the fite%8

    G>H*%e!3ifft.3G66?

    B* C%o( the to(, eft %ect!#+e to the o%i+i#! si4e8+>+3)8si4e3f, )6, )8si4e3f, .66?

    L$-,ss ' Hi0*,ss F!"1%"'2 D$)i' Fi/#"!s

    1!se$ o# the (%o(e%t- th!t '"ti(-i#+ the FFT of t/o f"#ctio#s f%o' the s(!ti! $o'!i# (%o$"ces theco#vo"tio# of those f"#ctio#s, -o" c!# "se Fo"%ie% t%!#sfo%'s !s ! f!st co#vo"tio# o# !%+e i'!+es*As ! #ote, o# s'! i'!+es, it is f!ste% to /o% i# the s(!ti! $o'!i#*

    Ho/eve%, -o" c!# !so c%e!te fite%s $i%ect- i# the f%e"e#c- $o'!i#* The%e !%e t/o co''o#-$isc"sse$ fite%s i# the f%e"e#c- $o'!i#8

    Lo/(!ss fite%s, so'eti'es #o/# !s s'oothi#+ fite%s

    Hi+h(!ss fite%s, so'eti'es #o/# !s sh!%(e#i#+ fite%s

    L$-,ss F!"1%"'2 D$)i' Fi/#"!s

    Lo/(!ss fite%s8

    c%e!te ! b"%%e$ 3o% s'oothe$6 i'!+e

    !tte#"!te the hi+h f%e"e#cies !#$ e!ve the o/ f%e"e#cies of the Fo"%ie% t%!#sfo%' %e!tive-

    "#ch!#+e$

    Th%ee '!i# o/(!ss fite%s !%e $isc"sse$ i# Digital Image Processing Using MA!A"8

    )* i$e! o/(!ss fite% 3IL0F6.* 1"tte%/o%th o/(!ss fite% 31L0F62* G!"ssi!# o/(!ss fite% 3GL0F6

    The co%%es(o#$i#+ fo%'"!s !#$ vis"! %e(%ese#t!tio#s of these fite%s !%e sho/# i# the t!be beo/* I#the fo%'"!e, D0is ! s(ecifie$ #o##e+!tive #"'be%* D(u,v) is the $ist!#ce f%o' (oi#t (u,v) to thece#te% of the fite%*

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

    http://www.cs.uregina.ca/Links/class-info/425/Lab4/M-Functions/paddedsize.mhttp://www.cs.uregina.ca/Links/class-info/425/Lab4/M-Functions/paddedsize.m
  • 7/23/2019 Source Code Domain Frekuensi

    5/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    Hi0*,ss F!"1%"'2 D$)i' Fi/#"!s

    Hi+h(!ss fite%s8

    sh!%(e# 3o% sho/s the e$+es of6 !# i'!+e

    !tte#"!te the o/ f%e"e#cies !#$ e!ve the hi+h f%e"e#cies of the Fo"%ie% t%!#sfo%' %e!tive-

    "#ch!#+e$

    The hi+h(!ss fite% 3#$%6 is ofte# %e(%ese#te$ b- its %e!tio#shi( to the o/(!ss fite% 3#l%68

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    6/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    1ec!"se hi+h(!ss fite%s c!# be c%e!te$ i# %e!tio#shi( to o/(!ss fite%s, the foo/i#+ t!be sho/s theth%ee co%%es(o#$i#+ hi+h(!ss fite%s b- thei% vis"! %e(%ese#t!tio#s8

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    7/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    IMPLEMENTATION DETAILS WITH RESULTS:

    G%ssi' L$- Pss Fi/#"!

    MATLAB CODE

    i'!+e>i'%e!$3c!'e%!'!#*tif6?

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    Si+'!>):?

    H>fs(eci!3+!"ssi!#,' #,si+'!6?

    G>H*ifftshift3G6?

    +>%e!3ifft.3G66?

    fi+"%e,i'sho/3+,6

    OUTPUT

    Si0)3Dis#'"457

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    8/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    ORIGINAL IMAGE IMAGE AFTER G%ssi' LPF

    OUTPUT

    Si0)3Dis#'"487

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    9/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    ORIGINAL IMAGE IMAGE AFTER G%ssi' LPF

    G%ssi' L$- Pss Fi/#"!

    MATLAB CODE 9%si'0 (%'#i$' /,(i/#"!

    i'!+e>i'%e!$3c!'e%!'!#*tif6?

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    si+'!>):?

    H4/,(i/#"!9;0%ssi';

  • 7/23/2019 Source Code Domain Frekuensi

    10/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    i'!+e>i'%e!$3c!'e%!'!#*tif6?

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    si+'!>):?

    H4*,(i/#"!9;0%ssi';i'%e!$3c!'e%!'!#*tif6?

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    O%$e%>.?

    H4/,(i/#"!9;=#-;i'%e!$3c!'e%!'!#*tif6?

    Computer Graphics & Image Processing 7thTerm-SE UET Taxila

  • 7/23/2019 Source Code Domain Frekuensi

    11/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    O%$e%>.?

    H4*,(i/#"!9;=#-;i'%e!$3c!'e%!'!#*tif6?

    i'sho/3i'!+e6?

    ',#>si4e3i'!+e6?

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    H4/,(i/#"!9;i"/;

  • 7/23/2019 Source Code Domain Frekuensi

    12/12

    UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

    FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

    SOFTWARE ENGINEERING DEPARTMENT

    i'!+e>i'.$o"be3i'!+e6?

    F>fft.3i'!+e6?

    F>fftshift3F6?

    H4*,(i/#"!9;i"/;