image inpaintingreadmeWord文档下载推荐.docx

上传人:b****6 文档编号:20097281 上传时间:2023-01-16 格式:DOCX 页数:4 大小:16.21KB
下载 相关 举报
image inpaintingreadmeWord文档下载推荐.docx_第1页
第1页 / 共4页
image inpaintingreadmeWord文档下载推荐.docx_第2页
第2页 / 共4页
image inpaintingreadmeWord文档下载推荐.docx_第3页
第3页 / 共4页
image inpaintingreadmeWord文档下载推荐.docx_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

image inpaintingreadmeWord文档下载推荐.docx

《image inpaintingreadmeWord文档下载推荐.docx》由会员分享,可在线阅读,更多相关《image inpaintingreadmeWord文档下载推荐.docx(4页珍藏版)》请在冰豆网上搜索。

image inpaintingreadmeWord文档下载推荐.docx

thepicturewindowandtheconcolewindow.Theprimaryuseractivityisdrawingthemaskovertheareatoberepaired.Themaskisdrawnwiththeleftmousebuttonanderasedwiththerightmousebutton.WhenevertheuserinitiatesafileI/Ooperation,thefilenameistobetypedintotheconsolewindow.

leftmousedrag-drawmask

rightmousedrag-erasemask

'

C'

-clearmask

u'

-unlimitedundo(ofmaskdrawing)

r'

-redo(maskdrawing)

U'

-toggleundoon/off(offsavessomememory--notmuch)

b'

-brushsize(rotatebetweenthreesizes)

t'

-togglemaskdisplayon/off

c'

-cyclethroughmaskcolors

s'

-saveimage

M'

-savemask

L'

-loadmask

+'

-oneiterationofinpainting

d'

-oneiterationofanisotropicdiffusion

D'

-togglediffusionon/off

i'

-100iterations,followedbyastepofdiffusion,ifdiffusionison

I'

-2000iterations,followedbyastepofdiffusion,ifdiffusionison

V'

-specifyhowmanyblocksof100iterationsofinpaintingtodo,followedbyastepof

diffusion,ifdiffusionison

a'

-15iterationsofinpainting,followedby2stepsofdiffusion

A'

-specifyhowmanyblocksof15i/2d

 

INPAINTING:

Theinpaintingalgorithmmeasuresthesmoothnessoftheimageandusesthistodecidehowtoextendcontoursthroughthemaskedregion.ItusestheLaplacianasasmoothnessindicator.To

findedgecontours,weusavectorperpendiculartothegradient.Thegradientoftheimagepointsinthedirectionofgreatestincrease.Alongedges,thegradientpointsperpendiculartotheedgebecausethegreatestchangeinthevalueoftheimageisacrossanedge.

Imageinpaintingisaniterativealgorithmthatonlychangespixelsinthemask.Inordertogetfromstepntostepn+1:

defineL(x,y)=2DLaplacianatpixel(x,y)

dLisavector,thechangeinsmoothnesstotheleft,right,top,andbottomofthecurrentpixel

Nisavector,avectorperpendiculartothegradient

Gisascalar,ameasureofthelengthofthegradient

Updateisapixelarray

Imageisapixelarray,theimageatstepn

ImageNextisapixelarray,theimageatstepn+1

deltatisascalar,thestepsizeforupdatinganimage

foreverypixel(x,y)inthemask

dL(x,y)=(L(x+1,y)-L(x-1,y),L(x,y+1)-L(x,j-1))

N=normalizedvectorperpendiculartogradient

B=dL.N

G=length*(N)

Update(x,y)=B*G

ImageNext(x,y)=Image(x,y)+deltat*Update(x,y)

length*isaspecialmeasureoflengththatneedstobeusedinordertogetstableresults.Itis

definedas

_x-xdirection

_y-ydirection

_f-forwardderivative-calculatederivativeasdifferencebetweenpixelinfrontandcurrent

pixel

_b-backardderivative-calculatederivativeasdifferencebetweencurrentpixelandpixelin

back

_m-minimumofvalueand0

_M-maximumofvalueand0

if(B>

0)

length*=sqrt(Image_xbm^2+Image_xfM^2+Image_ybm^2+Image_yfM^2)

else

length*=sqrt(Image_xbM^2+Image_xfm^2+Image_ybM^2+Image_yfm^2)

ANISOTROPICDIFFUSION:

Aftereveryseveralstepsofinpainting,werunaniterationofanisotropicdiffusion.Anisotropic

diffusionisoneapproachtonoiseremovalbecauseittendstosharpenedgeswhilesmoothingover

continuousregions.Itisusedherefortworeasons.Ithelpstosmoothoversomeoftheparts

filledinbytheinpaintingalgorithm.Italsohelpstojoinedgesacrossthemaskastheyare

beingdrawninsothattheywillbecontinuous.WeadaptedRobertEstes'

s

MCDalgorithmforouruse.

OPTIMIZATIONS

Weimplementedanumberofoptimizationsinanefforttomaketheprogramfasterandmoreresponsive.TheimageiskeptinaformatthatGLcanreaddirectly(whichallowsforfairlyquickredraws).However,forlargeimages,eventhisincursanoticabledelay,soformostmaskandimagemanipulations,wedrawthechangedpixelsdirectlytothescreentoavoidwhole-imageredraws.Themaskitselfisstoredinabitfield,andwedevelopedfastalgorithmsforiterationandmodificationwhichutilizethefactthatthemaskisusuallysparse.

Undoandredoarealsomemory-efficient;

althoughwemustdynamicallyallocatememoryastheuserinteractswiththeprogram,weuseadynamic,scalablevectorclasswhichavoidscostlylinkedlistsandpointers.Asaresulteachpixelchangerequiresonlyabout10bytesofstorageonaverage(4eachfor

xandycoords,1forindicatingthetypeofoperation,and1[onaverage]forpointingtothenextvector).

Fortheinpaintinganddiffusionalgorithms,weusedinlinefunctionsandpass-by-referenceasmuchaspossible,andtriedtoavoidtediousiterationsoverthewholeimage.Diffusionisaverycostlyalgorithm;

ourcurrentimplementationrequiresabout3xasmuchmemorytorunastheoriginalimage.Therearelikelymoreefficientimplementationsoutthere,butwecouldn'

tthinkofabetterwaytoimplementitthatwouldstillbefast.

--------------------------------

PublishedPaper

psfile

OriginalPaper:

Preprint

http:

//www.ima.umn.edu/preprints/dec99/dec99.html

AnisotropicDiffusionCode

//info.cipic.ucdavis.edu/ftp/estes/

Implementationofinpainting

//www-users.itlabs.umn.edu/~rams0053/

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

当前位置:首页 > 小学教育 > 小学作文

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

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