- 1
- 0
- 约2.14万字
- 约 27页
- 2024-03-25 发布于安徽
- 举报
EBU723U-ImageandVideoProcessing-2014/15
Courseworkreportandexercises
Name: YuMa
Username: jpExercise1(a)
Reading/writingPGM/PPMimages:Thefirststeptowardsimageandvideoprocessingisreadingimagesfromfileandwritethemtofile.Thereexistdifferentstandardsthatstoretheinformationindifferentformats;beforeopeninganimage,knowledgeofthestandardisnecessary.TwowidelyusedimageformatsarePPMandPGM.ThePGMformatisagreyscalefileformatdesignedtobeeasytomanipulate.APGMimagerepresentsagreyscalegraphicimage.Formostpurposes,aPGMimagecanjustbethoughtofanarrayofintegers.ThenamePGMistheacronymofPortableGreyMap.”ThenamePPM*istheacronymfbrPortablePixelMap.Imagesinthisformat(oraprecursorofit)wereoncealsocalledportablepixmaps.1Itisahighlyredundantformat,andcontainsalotofinfbnnationthattheHumanVisualSystem(HVS)cannotevendiscern.However,asPGM,PPMisveryeasytowriteandanalyze.Thegoalofthefirstpartoftodayslabistoletstudentsbecomecomfortablewiththesetwofbnnats.
YouwillimplementfunctionstoreadandtowritePPMandPGMimages.Thefinaldemonstrationoftheimplementedsoftwarewillbedoneusingwell-knowntestimages:LENA,BABOON,PEPPERS,etc.YoucanfindPPMandPGMversionsoftheseimagesintheEBU723Uintranetpages.Thewritingfunctionmustaddascommentintheheader:imagecreatedbyyour_nameyour_surname,\
Includeinyoursubmissionthefileresultingfromreadingtheimagesprovidedandwritingthembackintheiroriginalformat.
Summarizein5pointstheoperationsnecessarytoreadaPGM/PPMimage:
Opentheimageinreadmode.
Ignorecommentsinthefile
DistinguishtheimageisaPGMorPPM.
Readinformationoftheimage.
Readmatrix.
Summarizein5pointstheoperationsnecessarytowriteaPGM/PPMimage:
Opentheimageinwritemode.
Writecommentsinthefile.
DecidewrittingaPGMorPPM
原创力文档

文档评论(0)