北邮国院视频图像处理Word文件下载.docx

上传人:聆听****声音 文档编号:978453 上传时间:2023-04-29 格式:DOCX 页数:29 大小:31.10MB
下载 相关 举报
北邮国院视频图像处理Word文件下载.docx_第1页
第1页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第2页
第2页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第3页
第3页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第4页
第4页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第5页
第5页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第6页
第6页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第7页
第7页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第8页
第8页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第9页
第9页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第10页
第10页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第11页
第11页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第12页
第12页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第13页
第13页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第14页
第14页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第15页
第15页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第16页
第16页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第17页
第17页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第18页
第18页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第19页
第19页 / 共29页
北邮国院视频图像处理Word文件下载.docx_第20页
第20页 / 共29页
亲,该文档总共29页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

北邮国院视频图像处理Word文件下载.docx

《北邮国院视频图像处理Word文件下载.docx》由会员分享,可在线阅读,更多相关《北邮国院视频图像处理Word文件下载.docx(29页珍藏版)》请在冰点文库上搜索。

北邮国院视频图像处理Word文件下载.docx

PortableGreyMap."

Thename"

PPM"

istheacronymfor"

PortablePixelMap."

Imagesinthisformat(oraprecursorofit)wereoncealsocalled"

portablepixmaps."

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.Ignorecommentsinthefile

3.DistinguishtheimageisaPGMorPPM.

4.Readinformationoftheimage.

5.Readmatrix.

Summarizein5pointstheoperationsnecessarytowriteaPGM/PPMimage:

1.Opentheimageinwritemode.

2.Writecommentsinthefile.

3.DecidewrittingaPGMorPPMimage.

4.Writeinformationoftheimage.

5.Writematrix.

WhatisthedifferencebetweentheidentifierP3andP6?

ForidentifierP3,theimageisstoredasASCIIandeachlineislessthan70characters.

ForidentifierP6,theimageisstoredasbinary.

P6formatissmallerthanP3formatandreadP6formatfileisfasterthanP3formatfile.

Exercise1(b)

Formatconversions:

inthispartofthelab,theimageswillbeconvertedfromcolourtogreyscale;

inotherwordsaPPMimagewillbeconvertedtothePGMformat.Youwillimplementafunctioncalled“BUPT_format_converter”whichtransformsimagesfromcolortogrey-scaleusingthefollowingYUVconversion:

Y=0.257R+0.504G+0.098B+16

U=0.439R+0.368G–0.071B+128

V=-0.148R–0.291G+0.439B+128

Whatcomponentrepresentstheluminance,i.e.thegrey-levels,ofanimage?

Yrepresentstheluminance.

Usetheeboxestodisplaytheresultsforthecolourtogrey-scaleconversion.

Lenacolour(RGB)

Lenagrey

Baboongrey

Babooncolour(RGB)

Isthetransformationbetweenthetwocolour-spaceslinear?

Motivateyouranswer

Thetransformationbetweenthetwocolour-spacesislinear.

Transformeachlayer,thencombineeachoutcome.OrTransformlayerstogether.Thesetwooutcomesaresame.

f(ax+by)=af(x)+bf(y)

DisplayintheboxtheLenaimageconvertedtoYUV3channelsformat.

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.

Exercise1(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.

Boxforthe4images

2horizontal

2vertical

2verticaland8horizontal

4verticaland4horizontal

Describeusingyourownwordsthealiasingproblemandhowtoavoidit,asappliedtosignalprocessing

Aliasingoccurswhenthesamplefrequencyisnothighenoughsothatathesampledsignalcannotrepresentatheoriginalasignals,liketheblurofimageedgesandapitchchangesaofmusic.

Toavoidit,weshouldchooseathesamplefrequencymorethantwiceofhighestfrequencyofsignalaccordingtoNyquistsampleatheory.Forpracticalasolutions,wealwaysincreasesamplefrequencyordecreasehighestsignalfrequency.

Givenascenesampledbyaccdwithminimumhorizontalsamplingfrequency10cm-1,whatisthemaximumhorizontalfrequencyintheimagethatcanbecorrectlyrepresented?

Fs=10cm-1

Fs=2*Fmax

SoFmax=5cm-1

Ifyousub-sampleanimage,whydoyouhavemoreproblemsrelatedtoaliasing?

Whenweadothis,thepixelsaareareduced.Asaresult,theresolutionaaredecresed.

Pastebelowaclearexampleofartifactsgeneratedbyaliasing.Forthistaskyoucanuseyourownchoiceofimage.Usetheboxbelowfortheimageandcomments.

4verticaland2horizontal

Exercise2(a)

Quantize:

Quantizationistheprocessofapproximatingthecontinuousvaluesintheimagedatawithafinitesetofdiscretevalues.Theinputofaquantizeristheoriginaldataandtheoutputisoneamongthefinitenumberoflevels.Thisprocessisanapproximation,andagoodquantizerisonewhichrepresentstheoriginalsignalwithminimumloss(quantizationerror).Inthislab,youwillworkwithascalaruniformquantizerappliedtogrey-scaleimages.

Lena,quantizationfactor2

Baboon,quantizationfactor8

Implementafunctionthatuniformlyquantizesgreylevelimages.Thefunctionwillallowthereductionofthenumberofgreylevelvaluesbyagivenfactorn(apowerof2).

Note.Tovisualizetheimage,youneedtore-mapitinthe8-bit-per-pixelrepresentation.Showtheresultsintheboxesbelow.

Peppers,quantizationfactor128

Peppers,quantizationfactor32

Usethegivenspacesforyouranswers.Donotextendthespacesorchangethefont-size.Page13

Isquantizationareversibleprocess?

Canyourecoverwhatyoudiscarded?

Brieflyexplain.

No,forthequantizationprocess,somecolourlevelarereducedandwecannotagetthembackbecauseweadonotknowwhichapixeldoweachangeintonearcolour.

WritetheresultsbacktoPGM/PPMfilesusingthefunctionyoucreated.Makesurethatyourwritingfunctionallocatesacorrectnumberofbitsperpixel.Whatisthesizeofthefilescomparedwiththeoriginal?

Giventheresults,whatisatypicalapplicationfieldforquantization?

Includeinyoursubmissiontheoutputfilesandcommentontheresults.

Thesizeoffilesbecomessmaller.Becausewereducesomecolourlevel,thebitsthatareusedforrepresentacolourarebecomesless.Thefileaarecompressed.IfaweuesfactorN,wegetanewfilehave1/Nsize.

Exercise2(b)

Histograms:

Thispartofthelabisdedicatedtoimageprocessingusinghistograms.Ahistogramisastatisticalrepresentationofthedatawithinanimage.Thehistogramcanberepresentedasaplotofthefrequencyofeachgreylevel.Thisrepresentationshowsthedistributionoftheimagedatavalues.Bymanipulatingahistogram,itispossibletoimprovethecontrastinanimageandtheoverallbrightnessortosegmentdifferentareasoftheimagebyapplyingoneormorethresholdstothehistogramitself.

Implementafunctiontooutputthehistogramvaluesofagivengreylevelimage.Displayintheboxestheresultinghistograms.

Lena

Baboon

Peppers

Ifyounormalizethevaluesofthehistogramsothattheysumto1,whatdoesthevalueofabinrepresent?

Representtheprobabilityofeachgreylevel

Exercise2(c)

Equalize:

Equalizationisoneofthepossibleimageprocessingalgorithmsimplementedusinghistograms.Histogramequalizationallowsuseenhancingthecontrastofimages.Histogramequalizationemploysamonotonic,non-linearmappingwhichre-assignstheintensityvaluesofpixelsintheinputimagesuchthattheoutputimagecontainsauniformdistributionofintensities(i.e.aflathistogram).

Implementafunctionthatequalizesgrey-scaleimagesbasedontheirhistogram.Theinputisagivengreylevelimage;

theoutputisthederivedimage

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高中教育 > 高考

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2