欢迎来到天天文库
浏览记录
ID:60774448
大小:18.41 MB
页数:28页
时间:2020-12-17
《北邮国院视频图像处理.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、EBU723U–ImageandVideoProcessing–2014/15CourseworkreportandexercisesName:_______YuMa______________Username:______jp_______________Exercise1(a)Reading/writingPGM/PPMimages:Thefirststeptowardsimageandvideoprocessingisreadingimagesfromfileandwritethemtofile.Thereexistdifferentstandardsthatst
2、oretheinformationindifferentformats;beforeopeninganimage,knowledgeofthestandardisnecessary.TwowidelyusedimageformatsarePPMandPGM.ThePGMformatisagreyscalefileformatdesignedtobeeasytomanipulate.APGMimagerepresentsagreyscalegraphicimage.Formostpurposes,aPGMimagecanjustbethoughtofanarrayofin
3、tegers.Thename"PGM"istheacronymof"PortableGreyMap."Thename"PPM"istheacronymfor"PortablePixelMap."Imagesinthisformat(oraprecursorofit)wereoncealsocalled"portablepixmaps."Itisahighlyredundantformat,andcontainsalotofinformationthattheHumanVisualSystem(HVS)cannotevendiscern.However,asPGM,PPM
4、isveryeasytowriteandanalyze.Thegoalofthefirstpartoftoday’slabistoletstudentsbecomecomfortablewiththesetwoformats.YouwillimplementfunctionstoreadandtowritePPMandPGMimages.Thefinaldemonstrationoftheimplementedsoftwarewillbedoneusingwell-knowntestimages:LENA,BABOON,PEPPERS,etc.YoucanfindPPM
5、andPGMversionsoftheseimagesintheEBU723Uintranetpages.Thewritingfunctionmustaddascommentintheheader:“imagecreatedbyyour_nameyour_surname”.Includeinyoursubmissionthefileresultingfromreadingtheimagesprovidedandwritingthembackintheiroriginalformat.Summarizein5pointstheoperationsnecessarytore
6、adaPGM/PPMimage:1.Opentheimageinreadmode.2.Ignorecommentsinthefile3.DistinguishtheimageisaPGMorPPM.4.Readinformationoftheimage.5.Readmatrix.Summarizein5pointstheoperationsnecessarytowriteaPGM/PPMimage:1.Opentheimageinwritemode.2.Writecommentsinthefile.3.DecidewrittingaPGMorPPMimage.4.Wri
7、teinformationoftheimage.5.Writematrix.WhatisthedifferencebetweentheidentifierP3andP6?ForidentifierP3,theimageisstoredasASCIIandeachlineislessthan70characters.ForidentifierP6,theimageisstoredasbinary.P6formatissmallerthanP3formatandreadP6formatfileisfasterthanP3formatfile.
此文档下载收益归作者所有