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

上传人:b****9 文档编号:13086332 上传时间:2022-10-04 格式: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

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

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

Reading/writingPGM/PPMimages:

Thefirststeptowardsimageandvideoprocessingisreadingimagesfromfileandwritethemtofile.Thereexistdifferentstandardsthatstoretheinformationindifferentformats;

beforeopeninganimage,knowledgeofthestandardisnecessary.TwowidelyusedimageformatsarePPMandPGM.ThePGMformatisagreyscalefileformatdesignedtobeeasytomanipulate.APGMimagerepresentsagreyscalegraphicimage.Formostpurposes,aPGMimagecanjustbethoughtofanarrayofintegers.Thename"

PGM"

istheacronymof"

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.

Displaytheresultsofsu

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

当前位置:首页 > 表格模板

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1