信号系统实验-信号与系统内容_第1页
信号系统实验-信号与系统内容_第2页
信号系统实验-信号与系统内容_第3页
信号系统实验-信号与系统内容_第4页
信号系统实验-信号与系统内容_第5页
已阅读5页,还剩59页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

AquickintroductionExperimentBeginfromhere,welearnWhatis?andWhatcanwedowith?BefamiliarwiththebasiccommandofCatchontheideaof ’sExperimentStartfromtheExperimentWhatisMATrixThisisaninteractivesoftwarepackagefornumericprocessingorientedtomatrixWhatcanwedo BasicArithmeticLogicalandrelationalPolynomialSetSignalSystems(linear,non-linear,control,…)*Design*SimulationInput/Outputdatafiles(textoranyothertypeofnumericalprocessingAllthisisdonebymeansof:+on-line+programsandRememberthatalltheseapplicationsarematrix-WhenyouneedTheon-linehelpofisverygood.Ifyoudon'tknowwhereto>>Specifichelpaboutaknowntopic(command,function,>>help>>helpKeywordsearchinthedescriptionsofthe>>lookfor>>lookforSetsofprogramsdevelopedforaspecificfield.DifferentToolboxesprovidedbyMathWorksImageSignalControlSymbolicNeuralFuzzyYoucanmakeyourownAfirsttry...(on-line>>ans=>>d=[123;456;78d124578hasmanybuilt-infunctions:>>sqrt(64)ans=8>>sin(pi/2)ans=1>>abs(-56)ans=>>e=ones(3,3)e=111111>>size(e)ans=3Matrixmanipulationisvery>>f=d+ef=235689>>ans253647>>ans(2,3)ans=9>>g=d*g=66615152424>>h=d+3*eh=45781011>>k=k=2356>>m=cos(k)m=-0.4161-0.9899-0.28360.9601>>matrix_product=h*???Errorusing==>Innermatrixdimensionsmust>>matrix_product=k*hmatrix_product=6978132150>>elements_product=k.*???Errorusing==>Matrixdimensionsmust>>elements_product=k.*melements_product=-0.8322-2.9697-1.41805.7606Youcanusecomplex>>c1=3+4i;exp(c1)ans=-13.1288-Rememberthatinthiscaseexp(a+bi)isexp(a)[cos(b)+i*sin(b)>>a=[1+i2a1.0000+1.0000i>>b=[4-2i5+10i>>a+bans=5.0000-1.0000i7.0000+The"colon"(:)>>numbers1=2:2:8numbers1=246>>numbers2=2:8numbers2=234567>>numbers3=numbers2(1:2:5)numbers3=24>>2:.5:ans22.533.5>>6:-.5:ans65.554.5RepresentationofWecanrepresent3x2-2x+1>>p=[3-2andgetits>>r=>>rr=0.3333+0.3333-Therearemanybuilt-infunctionsformanipulationofpolynomials(e.g.ProgramsOpenthebuilt-ineditor( :File-New-MFile)totypethefollowingprogramortypeitinanytextpower=x=6:y=x.^power;Saveas.mfile(forexample:nothing.mIfyousavedyourfileinthedirectory:d::\userthentypethefollowinglineinthecommand>>cdCallyourprogramfromthecommand>>nothingpower=3ansColumns1through6789102163435127291000Columns7through121314172821972744You sorunyourprogramsfrom BasicOpenanewfileinthetexteditorandtype:functiony=cosgen(x,a,f,p)%COSGENGenerationofacosine%y=%y-cosineof%a-%f-frequency%p-phasey=a*cos(2*pi*f*(x+p/(2*pi*f)));saveascosgen.mSomething>>helpCOSGENGenerationofacosinewavey=cosgen(x,a,f,p)y-cosineofxa-amplitudef-frequency[hertz]p-phase[radians]CreateavectorXforyour>>xx=0:1/75:Callyourfunctionfromthecommandwindow>>yy=Basic>>plot(xx,yy)Let’strya3Dplot:>>>>MoreAfunctionin canreturnamatrix.Let’sredefineourcosgenfunction:function[tt,xx]=cosgen2(a,f,p,d,s)%COSGENGenerationofacosine%%tt-time%xx-cosineof%a-%f-frequency%p-phase%d-duration%s-samplesperperiodtt=[0:1/(s*f):d];%Herewedefinethetimevectorxx=a*cos(2*pi*f*(tt+p/(2*pi*f)));%Cosineofttsaveascosgen2.mTry>>cosgen2(11,5,-pi/2,.5,15)ans=>>[x,y]=cosgen2(11,5,->>xx=>>yy=>>Now,plotthevectorsyoujust>>>>>> BasicoperationsonExperimentBefamiliarwiththebasicoperationsonKnowhowtodrawtheforegonesignal’sgraphwiththehelpUnderstandthedifferenceofthecommand“plot”andExperimentAmplitudescaling,Timescaling,Timeshifting,TimereflectionExperimentContinuoussignalsarerepresentedbyx(t),wheretnormallydenotestime.Thesignaliscalledbecauseavalueofx(t)existsforallpossiblevaluesoft(e.g.0.1,0.12,0.123879933456778,Wecanvisualisethesignalx(t)2cos(2ft

,ascycles=input('Numberofcycles?');freq=input('Frequency?');phase=input('Phaseindegrees?');%Convertphasetoradianst=0:period/50:cycles*period;xlabel('time-seconds')Typicaloutput(cycles=4,frequency=100Hz,phase=50

Familiariseyourselfwiththeprocessof Selectandcopy(totheclipboard)theprograminthepageabove(justbeforetheFrom File|New|Mfile.ThiswillstartPastethecontentsoftheclipboard(i.e.theSavethefileas (doublequotesareneeded)andexitAtthe“>>”prompt,type“LAB”(withoutthequotes).Thiswillrunthe scriptprovided.Observetheoutputforcycles=2,freq=100,phase=0.Dothesamewithcycles=2,freq=100andphase=30.Andagainwithcycles=2,freq=100andphase=180.Althoughthesignalontheplotappearstobecontinuous,torepresentitonthecomputerwehadtousespecificvaluesoftinanascendingorder.Inthiscase,wetook:t=0,period/50,2*period/50,2*period/50,…,Whatwehavedoneistoregularlysamplex(t)usingatimeinterval(orsamplingperiod)ofT=period/50i.e.fort=0,T,2T,3T,…..Theoriginalsignalisnowrepresentedbythediscretesequence:x(0),x(T),x(2T),...,x(NT)x(nT)

(Note:giventhatthesamplingperiodTisusuallyknown,discretesignalisnormallydenotedbyx(n),wheren=0,1,2,…iscalledthesampleAdiscretesignalonlyhasdefinedvaluesatthesamplingpoints.Inwecanprocessdiscretesequenceswhichweuseasapproximationstocontinuoussignals.IfthesampleperiodTissufficientlysmall,thediscretesignalwillbeagoodapproximationofthe(original)continuoussignal.Conversely,ifthesamplingperiodistoolarge,thediscretesignalwillbeapoorrepresentationofthe(original)continuoussignal.Forvisualisationpurposesonly(rememberthatthediscretesignalisnotdefinedforvaluesoftbetweensamples),inplotsthedifferentsamplesarejoinedbystraightlines.Toshowtheeffectofdifferentsamplingperiodswecanmodifytheaboveprogramto:cycles=input('Numberofcycles?');freq=input('Frequency?');phase=input('Phaseindegrees?');sampcycle=input('Samplespercycle');%Convertphasetoradianst=0:period/sampcycle:cycles*period;xlabel('time-seconds')Ex.1_2:Theaboveprogramhasalreadybeenpreparedforyou!Atthe">>"prompt,type"LAB"andobservethebehaviourofthediscretesignalforcycles=2,freq=100,phase=0,sampcycle=50.Tryagainwiththesamevaluesofcycles,freqandphaseandwithsampcyclevaluesof25,10,5and2.In,a"truer"plotofadiscretesignalisobtainedusingthe"stem"command.Eachsampleisshownasaverticalline(heightproportionaltothevalueofthesignal)terminatedwithacircle.WecanthinkofadiscretesequenceXasanarraywithelementsX(1),X(2),X(3),….Thecommand"stem(X)"thendisplaystheseelementsinthesameorder(theyaxisshowsthevaluesinthearrayandthexaxisshowstheindices1,2,3,…).Alternatively,wecsodefineacorrespondingarrayT(ofthesamesizeasarrayX)whoseelementsT(1),T(2),T(3),….containthecorrespondingvaluestoshowinthexaxiswiththecommand"stem(T,X)".Clearly,inthiscaseTcanrepresenttimeandwhatisplottedisX(T(1)),X(T(2)),X(T(3)),….Atthe">>"prompttype"LAB"andentervaluesofcycles=2,freq=100,phase=0,Fromtheprogramlistingshownabove,itcanbeseenthattheprogramdefinesarraysxandt.Thevaluesinthesearrayscanbeshowninthescreen.Forexample,toseethefirstvalueinthexarraytype"x(1)".Toseethesecondvalueinthetarray,typet(2).Thecontentsofthewholearraycanbeseenbysimplytythearrayname.Forexample,toseeallsevenvaluesofx,type"x".Type"stem(x)".ThevaluesofxareplottedusingindicesType"stem(t,x).Thevaluesofxareplottedusingindicest(1),t(2),Digitalsequencesofanycomplexitycanthereforebegeneratedanddisplayed.Forexampleforthediscrete(NotethedifferenceinthevaluesonthexaxisforeachThesamplenumberndoesnotneedtobealwayspositive.Forexample:n=-5:10;(Notethedifferencebetween"stem"andEx.1_4.Generateandplot(using"stem")thefollowing0.1n,-10n10n -10n1en/10,0nLetx(n)beasignalwithinagivenrange.Amplitudescaling:y(n)=ax(n),whereaisaconstant(amplification).Timescaling:y(n)=x(an),whereaisaconstant.Timeshifting:y(n)=x(n-),whereisaconstant(timeTimereflectionTwosignalsx1(n)andx2(n)csobeadded,y(n)=x1(n)+x2(n)byaddingthevaluesateachcorrespondingsample.Alltheabovecanbecombinedinmorecomplexoperationse.g.y(n)=ax1(n-)+bx2(-2n+%definethesamplerangen=-10:10;%Twosinusoidalsignals+plotx1=cos(0.1*pi*n);x2=sin(0.2*pi*n);plot(n,x1,n,x2);input('x1,x2.EnterRETURNto%adelayedx1input('Delayedx1.EnterRETURNto%Alinearcombinationofx1andx2Ex.In'sCommandWindow,selectFileNewM-File(tocreateanewprogram).Thiswillinvokethetexteditor(NOTEPAD).TypeintheaboveprogramandsavetoafileinD:\USERe.g.In'sCommandWindow,atthe">>"prompt,type"myprog"toexecutetheConsiderthe754n5,for5n 543x(n) 152,10n30.20,

10 nSupposewewanttocomputeanddisplaythe y1(n)x(n

y2(n)

y3(n)x(n

Weneedtothinkaboutthe"useful"rangeinnforthesesignals(i.e.whereintimeoccur:havenon-zerovalues).y1(n)isx(n)delayedby20samples,thusitsusefulrangeis[5+20:15+20]=[25:35].y2(n)isx(n)"folded"intime,i.e.amirrorreflectionaboutthey-axisintheplot(whichalsomeansthatoccursbeforex(n),intime).So,itsusefulrangeis[-15:-5].Finally,y3(n)isy2(n)delayedby10samples,thusitsusefulrangeis[-15+10:-5+10]=[-5:15].Thecombinedusefulrangeforthesesignalsistherefore[-15:35].Apossiblesolutioninis:%defineoverallrangeandsamplevalues(n),addsomeextraspaceforniceplots!minn=-n=minn:%createarraysforx,itselementsareinitiallyzero.size(n)givesthesizeofthearrayn% ,arrayxisindexedby%So,x(n=minn)isstoredin's%Foranyk,x(k)isstoredin'sx(k-%Definearrayx(noteFORloop)fork=5:10fork=11:15%Displayx%Displayxintherange%x(k1:k2)meanspartofthearrayxbetweenindicesk1and2stem(n(3-minn+1:17-minn+1),x(3-minn+1:17-minn+1));Note:Theprogramspresentedherehavebeenwrittentoillustratesomebasicfeaturesof.Theyhavenotbeen"optimised".Thereareother(andsimpler)waystoachievesameresults.Defineavectornxtobethetimeindices-3n7andthevectorxtobethevaluesofthesignalx[n]atthosesamples,wherex[n]isgivenby:2,nx[n]1,n3,nIfyouhavedefinedthesevectorscorrectly,youshouldbeabletoplotthisdiscrete-timesequencebyLab3SystemRepresentationandSystemExperimentComprehendtheclassificationandresponseofStudytomakesuseofthetorealizeimpulseresponseandstepresponseoftheExperimentMakeuseofthe impulse(),thestep()andtheimpz()functionstorealizetheunitExperimentTothecontinuoussystemofLTI,Regarditsinputsignalasf(t),impulserespondencesignalash(t),zerorespondenceasy(t),then:y(t)

f(t)TheprovidesusthefunctionimpulseandsteptosolvetheimpulseresponseandstepresponseofthesystemanddrawitsfigureWhileusingthefunctionimpulse()andstep(),WeneedtousethevectortoRepresentthe Supposethedifferentialequationwhichdescribesthecontinuoussystemas

ay(i)(t)

f(j)Thenwecanexpressthatsystemwiththevectoraandb,a[a,a

j Forexample,tothedifferentialy''(t)3y'(t)2y(t)Thevectoraandb

f''(t)f 2]; IMPULSE()plotstheimpulseresponseoftheLTI.ithasafewofusageasItcanplottheimpulseresponseoftheLTIwithThevectoraandbindefaultForexample,tothedifferentialy''(t)5y'(t)6y(t)3f'(t)2fTrythisMatalbcommand:a=[156];b=[03NowyoucanseethetheimpulseresponseoftheItcanplottheimpulseresponseoftheLTIwiththevectoraandbintherangeofTotheaboveexample,Trythis:NowyoucanseethetheimpulseresponseoftheLTIintherangeofItcanplottheimpulseresponseoftheLTIwiththevectoraandbintherangeoft1~t2,andEvensamplingwiththetimeintervalp.Totheaboveexample,TryNowyoucanseetheimpulseresponseoftheLTIintherangeof1~2,,andEvensamplingwiththetimeinterval0.1.STEP()plotsthestepresponseoftheLTI.ithasafewofusageassameasimpulse():Totheaboveexample,ifyoutryyouwillseethethestepresponseofthePracticeAccordingtothedifferentialequationofoneLTI2y''(t)y'(t)8y(t)fTrytoplotstheimpulseresponseandstepresponseofthe3.TothediscretesystemofLTI,Regarditsinputsignalasf(k),impulserespondencesignalash(k),zerorespondenceasy(k),

y(k)f(k)Theprovidesusthefunctionimpz()tosolvetheunitimpulseresponseofthesystemanddrawitsSupposethedifferentialequationwhichdescribesthediscretesystemas

ay(ki)bf(kThenwecanexpressthatsystemwiththevectoraandb,a[a,a

b[b,b,,b,bForexample,tothedifferentialy(k)y(k1)2y(k2)fThevectoraandba=[1–1Impz()hasafewofusageasItcanplottheunitimpulseresponseoftheLTIwithThevectoraandbindefaultForexample,tothedifferentialy(k)y(k1)0.9y(k3)f(k)TrythisMatalbcommand:a=[1-10.9];NowyoucanseethetheimpulseresponseoftheItcanplottheimpulseresponseoftheLTIwiththevectoraandbintherangeof0~n.(nmustbeTotheaboveexample,Trythis:impz(b,a,60)NowyoucanseethetheimpulseresponseoftheLTIintherangeof③ItcanplottheimpulseresponseoftheLTIwiththevectoraandbintherangeofn1~n2(n1,n2mustbeinteger,andn1<n2)Totheaboveexample,Tryimpz(b,a,-NowyoucanseetheimpulseresponseoftheLTIintherangeof-PracticeAccordingtothedifferentialequationofoneLTI2y(k)2y(k1)y(k2)f(k)3f(k1)2f(kTrytoplotstheunitimpulseresponseoftheLTIintherangeofExperiment

Lab4ImageComprehendtheFouriertransformandStudytoprocessingtheoriginalimageswithdifferentExperimentFourierExperimentAccordingtothegivenimages,thestudentsmustdesignthedifferentfilter,suchasadifferentiatingMethod:Designthefiltertoprocesstheimagesthataregivendifferentrequires,suchassmoothingandDigitalAnIntroductiontoDigitalImagesareawayofrecordingandpresentinginformationinavisualform.Thus,imagescanbethoughtofaspictures,howeverinthebroades seanimagecancorrespondtoanykindoftwo-dimensionaldata.Digitalimageprocessingreferstoimagesbeingmanipulatedbydigitalmeans,mostcommonlycomputers.Thenaturallyoccurringformofimagesisnotsuitableforprocessingwithcomputers,ascomputerscannotoperatedirectlyonpictorialdatabutrequirenumericaldata.Thereforeimagesneedtobeconvertedintonumericaldata,referredtoasdigitalimages,toenablecomputermanipulation.Adigitalimagecorrespondstoanarrayofrealorcomplexnumbersrepresentedbyafinitenumberofbits,showingvisualinformationinadiscreteform.Althoughinsomecasesdigitalimagesmightdirectlybesynthesizedindiscreteform,mostcommonlytheyaretranslatedfromaphysicalimage.Thetranslationfromaphysicalimageintoanappropriatedigitalformis plishedbyan oguetodigitalconverter(ADC)thatcarriesoutsamplingandzation.Samplingistheprocessofmeasuringthevalueofthephysicalimageatdiscreteintervalsinspace.Mostcommonlyarectangularsamplinggridisemployed.Eachimagesamplecorrespondstoasmallregionofthephysicalimage,andiscalledapictureelement,orpixel.ThesamplingprocessisshowninFigure1-1.Adigitalimagethuscorrespondstoatwo-dimensionalarrayofpixels.Acommonapproachistoindexdigitalimagepixelsbyxandycoordinateswiththeupperleftcornertakenasorigin,andxandybeingintegervalues.ThisconventionisshowninFigure1-2.Thehorizontalandverticalsamplingrates,thusthenumberofpixelsinthehorizontalandverticaldirection,givethepixeldimensionsoftheimage.Adigitalimageconstructedby640samplesinthehorizontaldirectionand480samplesintheverticaldirectionisreferredtoasa640480image.Animagepixeldimensionof640480isthecommonbroadcaststandard.Digitalstillcamerasdirectlyproducedigitalimageswhereusuallytheimagedimensioncanbesetbytheuser,suchas1024768,12801024,etc.Thephysicalsizeofapixelinanimageisdefinedbythespatialresolution.Thespatialresolutionofanimageiscommonlyexpressedsynonymouslyintermsofdots-per-inch(dpi)orpixels-per-inch(ppi).Forafixedphysicalimageregion,densesamplingwillresultinahighresolutionimagewithalargenumberofpixelseachcontributingasmallpartofthescene,whilecoarsesamplingwillresultinalowresolutionimagewithasmallnumberofpixelseachcontributingalargepartofthescene.Therelationbetweenthephysicaldimensionsoftheimage,thepixeldimensionsoftheimageandthespatialresolutionisstraightforward:thepixeldimensionsofanimagecanbeobtainedbymultiplyingrespectivelythephysicalwidthandheightoftheimagebytheresolution.Forexamplea10”12” scannedat300dpiwillresultinadigitalimageofdimensions30003600pixeldimensions=physicaldimensionsFigure1-3showstherelationbetweenimageresolution,physicaldimensionsoftheimageandpixelsdimensionsoftheimage,andtheireffectsonvisualappearance.Commonlypixeldimensionsareused ogouslywithphysicaldimensions,assumingaconstantimageresolution,inwhichcasethephysicaldimensionsoftheimagearechangedaccordingtochangesinpixeldimensions.zationistheprocessofreplacingthecontinuousvaluesofthesampledimagewithadiscretesetofzationlevels.Thenumberofzationlevelsemployedernstheaccuracybywhichtheimagevaluesaredisplayed.ConventionallyLzationlevelsaredefinedbyintegersrangingfrom0toL-1,usually0correspondingtoblackandL-1correspondingtowhite,withintermediaevelsrepresentingvariousshadesofgrey.Allgreylevelsrangingfromblacktowhitearecollectivelyreferredtoasgrayscale.Grayscaleimagesdonotconveyanycolorinformation.Forconvenienceandefficiencythenumberofzationlevelsisusuallyanintegralpoweroftwo:L=2b,sothatthatatotalofbbitsmayusedtorepresentLdifferentzationlevels.Thenumberofbitsusedtodefineapixelvalueiscalledthebitdepth.Thegreaterthebitdepththegreaterthenumberofzationlevelsandthusthetonesthatcanberepresentinthedigitalimage.Animagerepresentedbyonly1pixelwith0representingblackand1representingwhiteiscalledabi-tonalorbinaryimage.Typicallyabitdepthof8bitsisemployedindigitalimagingsothat256possiblegreylevelsrangingfrom0(black)to255(white)areusedaspixelvalues.ThisisshowninFigure1-4.Figure1-5showsanimageatbitdepthsof1bit/pixel,4bits/pixeland8bits/pixel.Itisclearthat1bit/pixelisinsufficienttodisplayimagedetailbutat4bits/pixelthevisualappearanceisreasonable.ImageRe-samplingandRawItispossibletochangethepixeldimensionsofadigitalimagebyre-sampling.Asimpleapproachistodroppixelsatregularintervalstoreducethepixeldimensions,orduplicatepixelstoincreasepixeldimensions.Whiledropisanefficientmethodforreducingpixeldimensionsofanimage,inthecaseofincreasingpixeldimensionssimpleduplicationresultsinvisuallyobservableblockingeffectsdegradingvisualqualityoftheconstructedimage.Insteadofreplicatingimagepixelsitispreferabletointerpolatenewpixelsin-betweentheoriginalpixelsinanappropriateway.Therearevariousinterpolationtechniques,suchasbi-linearinterpolation,cubicsplineinterpolationandquadraticinterpolation,whichensurethatinterpolatedpixelvaluesarereasonablycomputedfromtheoriginalpixelpattern.Figure1-6showstheeffectofduplicating(alsocalledzero-orderinterpolation)imagepixelstoincreasepixeldimensionsofanimageaswellasbi-linearinterpolationofimagepixels.Itisclearlyseenthatinterpolationavoidsblockingartifacts.Imagesthatdonotcontainanyformatting,butjustthezedpixelvaluesarecalledrawimages.Rawimagesmaycontainaheaderthatspecifiesthepixeldimensions(widthandheight)oftheimage,ormaycontainonlythepixelvalueswithnoheaderatall.Inthesecondcaseitisrequiredthattheuserspecifiesthewidthandheightoftherawimagesothatitcanbeconstructedproperly.Asnoformattingisavailableforrawimages,therawimageconstitutesanarrayofpixelvaluesoflengthwidthheight.Imagesarebyde-factostoredandprocessedinrow-order,sothatpixelvaluesareencounteredlinebyFigure1-7showstheeffectofsupplyingincorrectpixeldimensionsforarawimage.Ifthewidthisdcorrectly,theimageisproperlyformattedas ofeachlineofpixelsiscorrectlyknown,yetiftheheightisincorrecttheimageissimplycroppedatthespecifiedheight.Ifthewidthoftheimageisincorrectthentheimagecannotbeformattedappropria yas ofeachlineofpixelsistakenincorrectly.BasicImageAnIntroductiontoImageImageprocessingreferstotheprocedureofmanipulatingimages.Commonlyimageprocessingiscarriedoutindigital meansofcomputers.Digitalimageprocessingcoversawiderangeofdifferenttechniquestochangethepropertiesorappearanceofanimage.Ontheeasiestlevel,imageprocessingcanbe bychangingthephysicallocationofthepixelsofanimage.Itispossibletotakethesymmetryofanimagebyreversingthepixelsaccordingtoasymmetrylocation.Figure2-1showstheresultofaverticalsymmetryandhorizontalsymmetry.Inthecaseofaverticalsymmetry,theprocesscanbethoughtofimagepixelsbeingupturnedwithrespecttoaverticalline.Ifimage1[x][y]representsthepixelvalueoftheoriginalimageatrowxandcolumny,andtheimagedimensionsaregivenaswidth×height,verticalsymmetrycanbeformulatedasimage2[x][y]=image1[width-x][y](0≤x<widthand0≤y<height).Inthecaseofhorizontalsymmetry,theresultantimageisgivenbyimage2[x][y]=image1[x][height-y].Itispossibletotakeincreasethenumberofpossiblesymmetriesbycombiningverticalandhorizontalsymmetriesandfurthermoreinterchangingrowandcolumnsofpixels.Itispossibletochangethelocationofpixelsofanimagebysimpletranslation.Ifallpixelsareshiftedtowardstheright,left,upordownwithoutchangingtheinterconnectiontheentireimagewillbetranslated.Figure2-2showstheresultofahorizontalandverticalshiftof20pixels.Thehorizontalshiftcanbeformulatedasimage2[x][y]=image1[x+.x][y]andtheverticalshiftcanbeformulatedasimage2[x][y]=image1[x][y+.y],where.xand.yarethehorizontalandverticaltranslationamountsinpixelsrespectively.Duetothetranslationsomepartoftheoriginalimagewillmoveoutofview,whilesomepartoftheresultantimageisunknownasaresultofcorrespondingpixelsbeingnotavailableintheoriginalimage,unknownregionsareleftblank(correspondingtopixelvaluesofzerorepresentedasblackregions).ItispossibletoemployverticalandhorizontalshiftsAnothertransformationthatcanbeappliedtoanimageisrotation.Inthiscase,thelocationsofpixelsinanimagearerotatedaroundacertainoriginbyadeterminedrotationangle.Usuallythecenteroftheimageisselectedasorigin,andtheimageisrotatedrespectively.Figure2-3showstheresultofarotationof60degreesincounterclockwisedirection.Asinthecaseoftranslationsomepartsoftheoriginalimagemaybelost,whilesomeblankregionswillappearintheresultantimage.Notethatrotationmightrequireinterpolationofpixelvalues,duetotransformationcharacteristics.Whilebasicimageprocessingchangesonlythelocationofimagepixels,i.e.takesthepixelsofanimageandmovesthemtoanotherlocation,anotherwayofmanipulatinganimageistocarryoutarithmeticoperationsonimagepixels.Itispossibletoadd/subtractanintegerto/frompixelvaluesormultiplyordivideimagepixelsbyaconstantvalue.Figure2-4showstheeffectofadding50tothevaluesofallpixelsofanimage.Clearlytheresultantimageappearscomparablybrighteraspixelvaluesaremovedtowardsthewhitelevel.Inthesamefiguretheimageresultingfromanadditionof150isdisplayed,duetotherelativelylargeamounttheimageappearsverybright,furthermorepixelvaluesexceedingtherepresentationrange(255forthis8-bitimage)aretruncatedatthehighestvalueresultingindominantwhiteregionsandlossofimagedetail.ImageEnhancement—PointImageenhancementistheprocessofemphasizingcertainimagefeatures,suchasedgesboundariesorcontrasttoimprovevisualappearanceorcontent.Imageenhancementisanimportanttopicinimageprocessingbecauseofitsusefulnessinalmostallimageprocessingapplications.“Pointoperations”constituteasimplebutefficientclassofimageenhancementtechniques.Thesetechniquesarecommonlyreferredtoaspointoperationsbecausethevalueofeachpixelisrecalculatedindependentlyofallotherpixelsaccordingtoacertaintransformation.Pointoperationsarealsocalledcontrastenhancement,contraststretchingorgray-scaletransformationtechniques.Pointoperationsaffecttheappearanceofanimagewhendisplayedandareoftenintegratedintoimagedigitizinganddisplayapplications.Pointoperationscommonlyinvolvetheadjustmentofbrightnessandcontrastinanimage.Thesetechniquesarecommonlyappliedtocompensateforimageacquisitiondrawbacks,suchasinsufficientlightingorcontrast.Atypicalapplicationisbacklightcompensation,whichcompensatesforunderexposedimagesincaseswhereanobjectofinterestisbacklit.LinearMap(LinearPointTheoverallbrightnessofagray-scaleimagecanbeadjustedbyaddingaconstantbias,b,topixelTheoverallbrightnessoftheimageisincreasedifb>0,anddecreasedifb<0.AnexampletoincreasingdecreasingthebrightnessofanimageisshowninFigure3-Thecontrastofagray-scaleimagecanbeadjustedbymultiplyingallpixelvaluesbyaconstantgain,Theoverallcontrastoftheimageisincreasedifa1,anddecreasedifa1.AnexampletoincreasinganddecreasingthecontrastofanimageisshowninFigure3-2.BrightnessandcontrastequationscanbecombinedtogiveasingleexpressionforbrightnessandcontrastSometimesratherthanspecifyingacertaingainorbias,itispreferredtodefineamapbetweenpixelvalues,inwhichcaseaparticularrangeofgreylevels,[f1,f2],ismappedontoanewrange,[g1,g2].ThismapcanbeplishedbytheThegraphicalrepresentationofbrightnessandcontrastmodificationthroughbiasandgainadjustmentisshowninFigure3-3(a)byplottingtheoutputgreylevelversusinputgreylevel.Thegraphicalrepresentationconfirmsthatbiasandgainadjustmentisequivalenttoalinearmapofpixelvalues.Asthedynamicpixelrangeoftheoutputimageischangedanddoesnotincludelowpixelvaluesduetothebias,insomecasesitispreferredtoonlystretchthecontrastasshowninFigure3-3(b).Incontraststretchingtheslopeischosengreaterthanunityintheregionofstretch,whiletheslopemightbelessthanunity(contrastreduction)inregionsthatareofnoconcern.Contraststretchingisparticularlyusedinimagesprovidinglowcontrastduetopoorornonuniformlightingconditionsorduetothenonlinearityorsmalldynamicrangeoftheimagingsensor.Clipisaspecialcaseofcontraststretchingwhereacertainrangeofgreylevels[fmax,fmin],ismappedtotheentiredynamicpixelrange([255,0]for8-bitimages).Thepixelsbelowfminareclippedtothelowestpixelvalue,andpixelsabovefmaxareclippedtothehighestpixelvalue.ThegraphicalrepresentationofclipisshowninFigure3-4.Clipisparticularlyusefuliftheinterestisinaparticularpixelrangeandpixelvaluesoutsidethisrangearenotimportant.Astheoutputmakesuseofthefulldynamicpixelrangeanoptimallinearcontraststretchingfortheparticularr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论