欢迎来到天天文库
浏览记录
ID:49368374
大小:178.50 KB
页数:13页
时间:2020-02-04
《Decomposition(四分树切割)与相关MATLAB指令简介.ppt》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、QuadtreeDecomposition(四分樹切割)與相關MATLAB指令簡介李棟良Contents黑白影像的四分樹表示法灰階影像的四分樹表示法MATLABdemo相關MATLAB指令簡介2黑白影像的四分樹表示法給一張黑白影像如圖1所示。利用四分樹的切割方式,可將圖1的影像以樹狀的方式表示成圖2。圖1黑白影像圖2四分樹表示法四分樹切割3灰階影像的四分樹表示法給一張灰階影像,利用四分樹的切割方式,亦可將影像以樹狀的方式來表示。Anoperationthatsubdividesanimageintoblocksthatcontain"similar"
2、pixels.某子影像(block)是否繼續分割是依據該子影像內之graylevel範圍是否超出臨界值(03、.qtsetblk-Setblockvaluesinquadtreedecomposition.qtgetblk-Getblockvaluesinquadtreedecomposition.8qtdecompS=qtdecomp(I,threshold)splitsablockifthemaximumvalueoftheblockelementsminustheminimumvalueoftheblockelementsisgreaterthanthreshold.thresholdisspecifiedasavaluebetween0and1.If4、Iisuint8,thethresholdvalueyousupplyismultipliedby255todeterminetheactualthresholdtouse.9qtdecompS=qtdecomp(I,threshold,mindim)willnotproduceblockssmallerthanmindim,eveniftheresultingblocksdonotmeetthethresholdcondition.10qtdecompS=qtdecomp(I,threshold,[mindimmaxdim])willnotprod5、uceblockssmallerthanmindimorlargerthanmaxdim.Blockslargerthanmaxdimarespliteveniftheymeetthethresholdcondition.maxdim/mindimmustbeapowerof2.11ViewthequadtreedecompositionofamatrixI=111123661121456811117777111166552022202212342022222054782022202091240122022202013141516S=qtdecomp6、(I,5);disp(full(S));400020200000000000002020000000004000202000000000000020110000001112Findthelocationsofall4x4blocksinthequadtreedecomposition>>SS=(1,1)4(5,1)4(1,5)2(3,5)2(5,5)2(7,5)2(1,7)2(3,7)2(5,7)2(7,7)1(8,7)1(7,8)1(8,8)1>>[i,j]=find(S==4)i=15j=1113
3、.qtsetblk-Setblockvaluesinquadtreedecomposition.qtgetblk-Getblockvaluesinquadtreedecomposition.8qtdecompS=qtdecomp(I,threshold)splitsablockifthemaximumvalueoftheblockelementsminustheminimumvalueoftheblockelementsisgreaterthanthreshold.thresholdisspecifiedasavaluebetween0and1.If
4、Iisuint8,thethresholdvalueyousupplyismultipliedby255todeterminetheactualthresholdtouse.9qtdecompS=qtdecomp(I,threshold,mindim)willnotproduceblockssmallerthanmindim,eveniftheresultingblocksdonotmeetthethresholdcondition.10qtdecompS=qtdecomp(I,threshold,[mindimmaxdim])willnotprod
5、uceblockssmallerthanmindimorlargerthanmaxdim.Blockslargerthanmaxdimarespliteveniftheymeetthethresholdcondition.maxdim/mindimmustbeapowerof2.11ViewthequadtreedecompositionofamatrixI=111123661121456811117777111166552022202212342022222054782022202091240122022202013141516S=qtdecomp
6、(I,5);disp(full(S));400020200000000000002020000000004000202000000000000020110000001112Findthelocationsofall4x4blocksinthequadtreedecomposition>>SS=(1,1)4(5,1)4(1,5)2(3,5)2(5,5)2(7,5)2(1,7)2(3,7)2(5,7)2(7,7)1(8,7)1(7,8)1(8,8)1>>[i,j]=find(S==4)i=15j=1113
此文档下载收益归作者所有