您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 造纸印刷 > 北邮国院视频图像处理
Usethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page1EBU723U–ImageandVideoProcessing–2014/15CourseworkreportandexercisesName:_______YuMa______________Username:______jp10212769_______________Exercise1(a)Reading/writingPGM/PPMimages:Thefirststeptowardsimageandvideoprocessingisreadingimagesfromfileandwritethemtofile.Thereexistdifferentstandardsthatstoretheinformationindifferentformats;beforeopeninganimage,knowledgeofthestandardisnecessary.TwowidelyusedimageformatsarePPMandPGM.ThePGMformatisagreyscalefileformatdesignedtobeeasytomanipulate.APGMimagerepresentsagreyscalegraphicimage.Formostpurposes,aPGMimagecanjustbethoughtofanarrayofintegers.ThenamePGMistheacronymofPortableGreyMap.ThenamePPMistheacronymforPortablePixelMap.Imagesinthisformat(oraprecursorofit)wereoncealsocalledportablepixmaps.Itisahighlyredundantformat,andcontainsalotofinformationthattheHumanVisualSystem(HVS)cannotevendiscern.However,asPGM,PPMisveryeasytowriteandanalyze.Thegoalofthefirstpartoftoday’slabistoletstudentsbecomecomfortablewiththesetwoformats.YouwillimplementfunctionstoreadandtowritePPMandPGMimages.Thefinaldemonstrationoftheimplementedsoftwarewillbedoneusingwell-knowntestimages:LENA,BABOON,PEPPERS,etc.YoucanfindPPMandPGMversionsoftheseimagesintheEBU723Uintranetpages.Thewritingfunctionmustaddascommentintheheader:“imagecreatedbyyour_nameyour_surname”.Includeinyoursubmissionthefileresultingfromreadingtheimagesprovidedandwritingthembackintheiroriginalformat.Summarizein5pointstheoperationsnecessarytoreadaPGM/PPMimage:1.Opentheimageinreadmode.2.Ignorecommentsinthefile3.DistinguishtheimageisaPGMorPPM.4.Readinformationoftheimage.5.Readmatrix.Summarizein5pointstheoperationsnecessarytowriteaPGM/PPMimage:1.Opentheimageinwritemode.2.Writecommentsinthefile.3.DecidewrittingaPGMorPPMimage.4.Writeinformationoftheimage.5.Writematrix.WhatisthedifferencebetweentheidentifierP3andP6?ForidentifierP3,theimageisstoredasASCIIandeachlineislessthan70characters.ForidentifierP6,theimageisstoredasbinary.P6formatissmallerthanP3formatandreadP6formatfileisfasterthanP3formatfile.Usethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page2Exercise1(b)Formatconversions:inthispartofthelab,theimageswillbeconvertedfromcolourtogreyscale;inotherwordsaPPMimagewillbeconvertedtothePGMformat.Youwillimplementafunctioncalled“BUPT_format_converter”whichtransformsimagesfromcolortogrey-scaleusingthefollowingYUVconversion:Y=0.257R+0.504G+0.098B+16U=0.439R+0.368G–0.071B+128V=-0.148R–0.291G+0.439B+128Whatcomponentrepresentstheluminance,i.e.thegrey-levels,ofanimage?Yrepresentstheluminance.Usetheeboxestodisplaytheresultsforthecolourtogrey-scaleconversion.Isthetransformationbetweenthetwocolour-spaceslinear?MotivateyouranswerThetransformationbetweenthetwocolour-spacesislinear.Transformeachlayer,thencombineeachoutcome.OrTransformlayerstogether.Thesetwooutcomesaresame.f(ax+by)=af(x)+bf(y)Lenacolour(RGB)LenagreyBaboongreyBabooncolour(RGB)Usethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page3DisplayintheboxtheLenaimageconvertedtoYUV3channelsformat.Arethecolorsofthepreviouspicturedistorted?Ifyeswhy?Theyaredifferent.BecauseRGBusedforPCandYUVusedforTV.IfweshowYUVimageonPC,itwillbedistorted.BasedontheformulafortheRGBtoYUVconversion,derivetheformulafortheYUVtoRGBconversion?R=1.164*(Y-16)+1.596*(V-128)G=1.164*(Y-16)-0.813*(V-128)-0.391*(U-128)B=1.164*(Y-16)+2.018*(U-128)UsetheformulayouderivedattheprevioussteptoconverttheYUVimagebacktotheoriginalRGBformat.Displaytheresultinthebox.Usethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page4Exercise1(c)Sub-sampling:TheHVSisincapableofperceivingcertaindetailsinanimage.ThereforehighcompressionratioscanbeachievedbyexploitingthecharacteristicsoftheHVS,thusdiscardingwhathasalowvisualrelevance.However,thisprocesscanintroducedistortionsinthecompresseddata.AsimplewaytoexploitthecharacteristicsoftheHVScompressionpurposesistosub-sampleanimage.Adrawbackofthisapproachisthatitispossibletoincurinwell-knowproblemsofadiscreterepresentation,suchasaliasing.Thispartofthelabcoverssomesimplesub-samplingoperations.Implementafunctionthatsub-samplesgreylevelimagesbyafactorn,withnamultipleof2.Thefunctionshouldbeabletosub-sampleindependentlyinthehorizontalandintheverticaldirectionorinbothdirectionsatthesametime.Displaytheresultsofsub-samplingtheimageLenausingthefollowingfactors:2horizontal,2vertical,2verticaland8horizontal,4verticaland4horizontal.Includethefilesoftheresultsinthesubmission.Boxforthe4images2horizontalUsethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page52vertical2verticaland8horizontal4verticaland4horizontalDescribeusingyourownwordsthealiasingproblemandhowtoavoidit,asappliedtosignalprocessingAliasingoccurswhenthesamplefrequencyisnothighenoughsothatathesampledsignalcannotrepresentatheoriginalasignals,liketheblurofimageedgesandapitchchangesaofmusic.Toavoidit,weshouldchooseathesamplefrequencymorethantwiceofhighestfrequencyofsignalaccordingtoNyquistsampleatheory.
本文标题:北邮国院视频图像处理
链接地址:https://www.777doc.com/doc-4431434 .html