Sample Dipum2e Project Statements

download Sample Dipum2e Project Statements

of 14

Transcript of Sample Dipum2e Project Statements

  • 8/12/2019 Sample Dipum2e Project Statements

    1/14

    Sample Projectsfor

    Digital Image Processing Using MATLAB 2nd edition

    Rafael C. GonzalezRichard E. WoodsSteven L. Eddins

    2009Gatesmark Publishing

    a division of Gatesmark, LLCISB ! 9"#09#20#$%00

    Book web site: www.image rocessing lace.com

    Version 1.

    Ma! 1" 2 #

    2009. This publication is protected by United States and international copyright laws, and is designedexclusively to assist instructors in teaching their courses or for individual use. Publication, sale, or other type ofwidespread disse ination !i.e. disse ination of ore than extre ely li ited extracts within the classroosetting" of any part of this aterial !such as by posting it on the #orld #ide #eb" is not authori$ed, and anysuch disse ination is a violation of copyright laws.

    http://www.imageprocessingplace.com/http://www.imageprocessingplace.com/
  • 8/12/2019 Sample Dipum2e Project Statements

    2/14

    %&PU'2e Pro(ect State ents Page 2

    Introd$ction

    &his do'ument 'ontains sam(le (ro)e't statements dealing *ith the first five 'ha(ters in the book+ &hese (ro)e'ts are intended to serve as guidelines for formulating (ro)e'ts dealing *ith other to(i's in the book+

    &he (ro)e'ts range in 'om(le it- from straightfor*ard e tensions of the material in the book to more'om(rehensive undertakings that re.uire several hours to solve+ /ll the material re.uired for the (ro)e'ts is'ontained in the book *eb site+ ormall-, the solutions are based on material that has been 'overed u( to the'ha(ter in .uestion, but *e often use material from later 'ha(ters in order to arrive at a *ell formulatedsolution+ In these instan'es, *e indi'ate *here the needed material is lo'ated in the book and, on rareo''asions, *e (oint to online resour'es+

    1ne of the most interesting as(e'ts of a 'ourse in digital image (ro'essing in an a'ademi' environment isthe (i'torial nature of the sub)e't+ It has been our e (erien'e that students trul- en)o- and benef it from

    )udi'ious use of 'om(uter (ro)e'ts to 'om(lement the material 'overed in 'lass+ Sin'e 'om(uter (ro)e'ts are inaddition to 'ourse *ork and home*ork assignments, *e tr- to kee( the formal (ro)e't re(orting as brief as

    (ossible+ In order to fa'ilitate grading, *e tr- to a'hieve uniformit- in the *a- (ro)e't re(orts are (re(ared+ /useful re(ort format is as follo*s!

    Page 1: Cover (age+Pro)e't titlePro)e't number Course number Student s name3ate due3ate handed in

    Abstract 4not to e 'eed 562 (age7

    Page 2: 1ne to t*o (ages 4ma 7 of te'hni'al dis'ussion+

    Page 3 (or 4): 3is'ussion of results+ 1ne to t*o (ages 4ma 7+

    Results: Image results 4(rinted t-(i'all- on a laser or ink)et (rinter7+ /ll images must 'ontain a number and titlereferred to in the dis'ussion of results+

    Appendix: Program listings, fo'used on an- original 'ode (re(ared b- the student+ 8or brevit-, fun'tions androutines (rovided to the student are referred to b- name, but the 'ode is not in'luded+

    Layout: &he entire re(ort must be on a standard sheet si e 4e+g+, #+$ b- 55 in'hes7, sta(led *ith three or moresta(les on the left margin to form a booklet, or bound using a 'lear 'over, standard binding (rodu't+

    /lthough formal (ro)e't re(orting of the nature )ust dis'ussed is not t-(i'al in an inde(endent stud- orindustrial6resear'h environment, the (ro)e'ts outline in this do'ument offer valuable e tensions to the materialin the book, *here length- e am(les are ke(t to a minimum for the sake of s(a'e and 'ontinuit- in the

  • 8/12/2019 Sample Dipum2e Project Statements

    3/14

    %&PU'2e Pro(ect State ents Page )

    dis'ussion+ Image (ro'essing is a highl- e (erimental field and :/&L/B, along *ith the Image Pro'essing&oolbo , offers an un(aralleled soft*are develo(ment environment+ B- taking advantage of :/&L/B sve'tori ation 'a(abilities solutions 'an be made to run fast and effi'ientl-, a feature that is es(e'iall- im(ortant*hen *orking *ith large image data bases+ &he use of 3IP;: &oolbo fun'tions is en'ouraged in order tosave time in arriving at (ro)e't solutions and also as e er'ises for be'oming more familiar *ith these fun'tions+

    &he reader *ill find the (ro)e'ts in this do'ument to be useful for both learning (ur(oses and as a referen'e

    sour'e for ideas on ho* to atta'k (roblems of (ra'ti'al interest+ /s a rule, *e have made an effort to mat'h the'om(le it- of (ro)e'ts to the material that has been 'overed u( to the 'ha(ter in *hi'h the (ro)e't is assigned+ solution to a given (ro)e't+ &he follo*ing 'riteria 'an be used as a guide*hen a (ro)e't 'alls for ne* 'ode to be develo(ed!

    ?o* .ui'kl- 'an I im(lement this solution@ ?o* robust is the solution for =rare> 'ases@ ?o* fast does the solution run@ ?o* mu'h memor- does the solution re.uire@ ?o* eas- is the 'ode to read, understand, and modif-@

    /lso, it is im(ortant to kee( in mind that solutions 'an 'hange over time, as ne* :/&L/B or ImagePro'essing &oolbo fun'tions be'ome available+

  • 8/12/2019 Sample Dipum2e Project Statements

    4/14

    %&PU'2e Pro(ect State ents Page *

    %&apter 2

    Sample Projects!R"#EC$ %.&

    :/&L/B does not have a fun'tion to determine *hi'h elements of an arra- are integers 4i+e+, + + +, 2, 5, 0, 5,2 , + + +7+

  • 8/12/2019 Sample Dipum2e Project Statements

    5/14

    %&PU'2e Pro(ect State ents Page +

    % A must be a numeric array.

    ;se of while or for loo(s is not allo*ed+ See Pro)e't 2+5 regarding numeri' arra-s+ Hint ! Be'ome familiar*ith fun'tion floor +

    !R"#EC$ %.(

  • 8/12/2019 Sample Dipum2e Project Statements

    6/14

    %&PU'2e Pro(ect State ents Page

    %&apter '

    Sample Projects!R"#EC$ '.& *ntensit+ $ransformation ,-a ing /0nction

  • 8/12/2019 Sample Dipum2e Project Statements

    7/14

    %&PU'2e Pro(ect State ents Page -

    % range of the input image (regardless of class) is divided into 256% increments for computing the histogram and the corresponding cumulative% distribution function (CDF). Recall that the CDF is actually the mapping% function used for histogram equalization.%% The output is of the same class as the input.

    Hint: our 'ode *ill be sim(lified if -ou use the fun'tion develo(ed in Pro)e't A+5 and fun'tion cumsum +

    !R"#EC$ '.' Local 1istogram E20alization

    The global histogram equalization technique is easily adaptable to local histogram equalization. The procedureis to define a square or rectangular window (neighborhood) and move the center of the window from pixel topixel. At each location, the histogram of the points inside the window is computed and a histogram equalizationtransformation function is obtained. This function is finally used to map the intensity level of the pixel centeredin the neighborhood to create a corresponding (processed) pixel in the output image. The center of theneighborhood region is then moved to an ad acent pixel location and the procedure is repeated. !ince only onenew row or column of the neighborhood changes during a pixel"to"pixel translation of the region, updating thehistogram obtained in the previous location with the new data introduced at each motion step is possible. This

    approach has obvious advantages over repeatedly computing the histogram over all pixels in the neighborhoodregion each time the region is moved one pixel location.

    #rite an $"function for performing local histogram equalization. %our function should have the followingspecifications.

    function g = localhisteq(f, m, n)%LOCALHISTEQ Local histogram equalization.% G = LOCALHISTEQ(F, M, N) performs local histogram equalization% on input image F using a window of (odd) size M-by-N to produce% the processed image, G. To handle border effects, image F is% extended by using the symmetric option in function padarray.% The amount of extension is determined by the dimensions of the% local window. If M and N are omitted, they default to% 3. If N is omitted, it defaults to M. Both must be odd.

    %% This function accepts input images of class uint8, uint16, or% double. However, all computations are done using 8-bit intensity% values to speed-up computations. If F is of class double its% values should be in the range [0 1]. The class of the output% image is the same as the class of the input.

    Hint: 1ne a((roa'h is to *rite a fun'tion that uses the results of Pro)e'ts A+5 and A+2+ &his *ill result in asim(ler solution+ ?o*ever, the fun'tion *ill be on the order of five times slo*er than a fun'tion that 'om(utesthe lo'al histogram on'e and then u(dates it as the lo'al *indo* moves throughout the image, one (i eldis(la'ement at a time+ &he idea is that the ne* histogram, "#ne$ , is e.ual to the to the old histogram, "#old ,

    (lus the histogram of data added as the *indo* is moved, "#datain , minus the histogram of the data that movedout of the *indo* as a result of moving the *indo*, "#dataout + &hat is! "#ne$ D "#old E "#datain "#dataout + In addition to being faster im(ortant advantage of this im(lementation is that it is self 'ontained+

    ote that the histograms "#datain and "#dataout are normali ed b- the fa'tor e.ual to the total number of (i els, %n, in order to be 'onsistent *ith the fa't that the area of histograms "#ne$ and "#old must be 5+0+

    our 'ode *ill be sim(lified if -ou use fun'tions cumsum and tofloat + Fee( in mind that onl- the intensit-level of the 'enter of the neighborhood needs to be ma((ed at ea'h lo'ation of the *indo*+

    !R"#EC$ '.( Com aring Global and Local 1istogram E20alization.

  • 8/12/2019 Sample Dipum2e Project Statements

    8/14

    %&PU'2e Pro(ect State ents Page

    ,a 3o*nload image FigP0304(a)(embedded_objects_noisy).tif and (ro'ess it *ith fun'tionlocalhisteq using neighborhoods of si es A A and " "+ (lain the differen'es in -our results+

    ,b ?istogram e.uali e it using the global fun'tion histeq2 from Pro)e't A+2+ If -ou did not do that (ro)e't,then use Image Pro'essing &oolbo fun'tion histeq + /lthough the ba'kground tonalit- *ill be different

    bet*een the t*o fun'tions, the net result is that global histogram e.uali ation *ill be ineffe'tive in bringing out

    the details embedded in the bla'k s.uares *ithin the image+ (lain *h-+ ote in both 4a7 and 4b7 ho* noise isenhan'ed b- both methods of histogram e.uali ation, *ith lo'al enhan'ement (rodu'ing noisier results thanglobal enhan'ement+

    !R"#EC$ '.) E3 erimenting with Larger 4La lacian5 -asks

    It is sho*n in am(le A+50 that the La(la'ian mask w# D H 5, 5, 5 5 J # 5 5, 5, 5K -ields a result shar(er thanthe result *ith a similar mask *ith a % in the 'enter+ ,a mask of arbitrar- odd si e+ 8or e am(le, the mask of si e $ $ *ould 'onsist of all 5s *ith a J2% in the 'enterlo'ation+ ,b 3o*nload the image FigP0305(blurry_moon).tif and 'om(are the results bet*een 8ig+A+5#4'7 in the book and the results obtained *ith masks of si e n n for n D $, 9, 5$, and 2$+ ,c (lain thedifferen'es in the resulting images+

  • 8/12/2019 Sample Dipum2e Project Statements

    9/14

    %&PU'2e Pro(ect State ents Page 9

    %&apter (

    Sample Projects

    !R"#EC$ (.& Working with the !ower S ectr0m and 6sing /0nctions varargout and varargin

    &he main ob)e'tives of this (ro)e't are to investigate the effe't that filtering has on average image (o*er and to (ra'ti'e using fun'tions varargout and varargin +

    /s dis'ussed in Se'tion %+5, the (o*er s(e'trum is defined as2

    4 , 7 4 , 7 P u & ' u &=*here 4 , 7 ' u & is the 8ourier transform of an image, 4 , 7 x y + &he a&erage i%age po$er is defined as

    254 , 7 A

    u &

    ' u & *

    =

    ,a

  • 8/12/2019 Sample Dipum2e Project Statements

    10/14

    %&PU'2e Pro(ect State ents Page /0

    /s indi'ated in Se'tion %+5 of the book, the 8ourier transform is 'om(le , so it 'an be e (ressed in (olar formas

    4 , 74 , 7 4 , 7 e u & ' u & ' u & =H ote that the e (onent is (ositive, not negative as it is sho*n in the initial (rinting of the bookK+ ?ere,

    56 22 24 , 7 4 , 7 4 , 7 ' u & R u & + u & = + is the s(e'trum and

    5 4 , 74 , 7 tan4 , 7

    + u &u &

    R u &

    =

    is the (hase angle+ &he (ur(oses of this (ro)e'ts are 457 to sho* that the (hase angle 'arries information aboutthe lo'ation of image elements, 427 that the s(e'trum 'arries information regarding 'ontrast and intensit-transitions, and 4A7 that (hase information is dominant over the s(e'trum regarding visual a((earan'e of animage+ 3o*nload FigP0402(a)(woman).tif and FigP0402(b)(test_pattern).tif 4'all themf and g 7+ It is re'ommended that -ou look u( fun'tions complex and angle before starting the (ro)e't+

    ,a Com(ute the s(e'trum and the (hase angle of image f and sho* the (hase image+ &hen 'om(ute the inversetransform using onl- the (hase term 4i+e+, ifft2 of 4 , 7e u & K and sho* the result+ ote ho* the image is void of

    'ontrast, but 'learl- sho*s the *oman s fa'e and other features+

    ,b Com(ute the inverse using onl- the magnitude term 4i+e+, ifft2 of 4 , 7 ' u & 7+ 3is(la- the result and noteho* little stru'tural information it 'ontains+

    ,c Com(ute the s(e'trum of g + &hen 'om(uter the inverse 88& using the s(e'trum of g for the real (art andthe (hase of f for the imaginar- (art+ 3is(la- the result and note ho* the details from the (hase 'om(onentdominate the image+

    !R"#EC$ (.' /0n !ro8ect: 9istorting Signs and S+mmetries in the /o0rier $ransform

    Interesting and sometimes nonsensi'al results are obtained *hen the s-mmetr- and signs in the 8ouriertransform are not (reserved, as the follo*ing (ro)e'ts sho*+

    ead image FigP0402(woman).tif , and obtain its s(e'trum, S , and (hase, P , as in Pro)e't %+2+ &hen,

    ,a Let S1 = S and S1(1:M/2, 1:N/2) = 0 *here [M, N] = size(S) + e'over the image usingS1 and P + Sho* -our result+

    ,b Let P2 = cong(P) , *here conj is the 'om(le 'on)ugate+ e'over the image using S and P2 + Sho*-our result+

    ,c In Cha(ter %, all filters used are ero (hase shift filters, *hi'h have no effe't on the (hase be'ause the-multi(l- the real and imaginar- 'om(onents of the transform b- the same .uantit-+ ?ere, *e *ant to sho* the

    effe'ts of 'hanging the real and imaginar- 'om(onents of the 8ourier transform differentl-+ Let F2 =complex(0.25*real(F), imag(F)) + ote that this affe'ts both the s(e'trum and the (hase+ ?o*ever, based on the results from Pro)e't %+2, *e e (e't that the effe't on the (hase *ill dominate in the re'overedimage+ 1btain the inverse transform and sho* the resulting image+

    !R"#EC$ (.( Bandre8ect and Band ass /iltering

    In the book *e dis'uss lo*(ass and high(ass filtering in detail+ /lthough used less often, bandre)e't and band(ass filters are an im(ortant 'ategor- of fre.uen'- domain filters, es(e'iall- be'ause the- are mu'h more

  • 8/12/2019 Sample Dipum2e Project Statements

    11/14

    %&PU'2e Pro(ect State ents Page //

    diffi'ult to im(lement using s(atial te'hni.ues+ &he transfer fun'tion of a Butter*orth bandre)e't filter 4BB 87of order n is

    2

    2 20

    54 , 7

    4 , 75

    4 , 7

    br n H u & , u & -

    , u & ,

    =

    +

    *here < is the *idth of the band, and 0 , is its 'enter+ &he 'orres(onding band(ass filter is given b-4 , 7 5 4 , 7bp br H u & H u &= +

    ,a

  • 8/12/2019 Sample Dipum2e Project Statements

    12/14

    %&PU'2e Pro(ect State ents Page /2

    ,a 3o*nload image FigP0406(blurry_moon).tif and im(lement in the fre.uen'- domain the ste(sleading to the images in 8ig+ A+5 4d7 in the book+ ou *ill note that -our image looks more like 8ig+ A+5#4'7,indi'ating that results obtained in the fre.uen'- domain more 'losel- resemble the s(atial results obtained usinga La(la'ian mask *ith a #, rather than a %, in the 'enter+

    ,b Generate a fre.uen'- domain filter from h = [1 1 1; 1 -8 1; 1 1 1] using the a((roa'hdis'ussed in Se'tion %+%+ ;se this filter to (ro'ess the image in the fre.uen'- domain and 'om(are -our result*ith 4a7+

    !R"#EC$ (.< 1omomor hic /iltering

    ,a ?omomor(hi' filtering attem(ts to a'hieve simultaneous redu'tion of the d-nami' range of an image and'ou(led *ith an in'rease in shar(ness 4see Gon ale and

  • 8/12/2019 Sample Dipum2e Project Statements

    13/14

    %&PU'2e Pro(ect State ents Page /)

    %&apter ) Sample Projects

    !R"#EC$ ).& Estimating =oise !9/s and $heir !arameters

    &he image in FigP0501(noisy_superconductor_image).tif is 'orru(ted b- noise+

    ,a 3o*nload this image and e tra't its noise histogram+ 3is(la- the histogram 4using fun'tion bar 7 andindi'ate 4b- name7 *hat -ou think the noise P38 is+ 3etermine the relevant noise (arameter4s7 using thehistogram -ou e tra'ted+ 4 Hint ! ;se fun'tion roipoly to e tra't the data -ou think *ill hel( -ou identif- thenoise+7

    ,b ;se fun'tion imnoise or imnoise2 , as a((ro(riate, to generate X sam(les of the noise t-(e and (arameter4s7 -ou determined in 4a7+ Generate the histogram of the sam(les using fun'tion hist , and dis(la-the histogram+ ?ere, X is the number of (i els in the 1I in 4a7+ Com(are *ith the 'orres(onding histogramfrom 4a7+

    !R"#EC$ ).% S atial =oise Red0ction

    ,a ;se fun'tion spfilt to denoise image FigP0502(a)(salt_only).tif + &his is an o(ti'almi'ros'o(e image of a ni'kel o ide thin film s(e'imen magnified 00N+ &he image is heavil- 'orru(ted b- saltnoise+

    ,b ;se fun'tion spfilt to denoise image FigP0502(b)(pepper_only).tif + &his is the same ni'kel

    o ide image, but 'orru(ted this time b- (e((er noise onl-+&he tradeoff in -our sele'tion of a filter in 4a7 and 4b7 should be to (rodu'e the 'leanest image (ossible *ith aslittle image distortion 4e+g+, blurring7 as (ossible+ 4 Hint: If -ou need to be'ome more familiar *ith the detailsof the filters available in fun'tion spfilt , 'onsult Cha(ter $ of Gon ale and

  • 8/12/2019 Sample Dipum2e Project Statements

    14/14

    %&PU'2e Pro(ect State ents Page /*

    *ave that often are .uite visible and diffi'ult to remove in the filtered image+ &hus, in this 'ase, the effe't of*ra(around error introdu'ed b- not using (adding usuall- is negligible b- 'om(arison+