91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 23KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-17
  • 語言: Matlab
  • 標簽: 未分類??

資源簡介

matlab開發-floodfillscanline。在matlab中使用洪泛填充或繪制桶工具,如imfill、scanline算法和動畫。

資源截圖

代碼片段和文件信息

function?ms=flood_fill(Irtol)
%?flood?fill?scan?line?algoritm
%?ms=flood_fill(Irtol)
%??ms?-?pixels?numbers?that?flooded
%?numbering:?number=y+szy*(x-1)?x?y?-?pixels?coordinaties
%?szx?szy?-?image?size
%?I?-?RGB?image
%?r-?first?point?of?selection
%?tol?-?tolerance


R=int32(I(::1));
G=int32(I(::2));
B=int32(I(::3));

[szy?szx]=size(R);?%?image?size

%?stek?where?seed?will?be?stored:
stm=10000;
st=zeros(stm2‘int32‘);
st(11)=r(1);
st(12)=r(2);?%?r?-?is?start?seed
stL=1;?%?stack?length

%?hp=plot(11‘.k‘);
%?
%?set(hp‘XData‘st(1:stL1)‘YData‘st(1:stL2));
%?drawnow;


%?found?pixel?store:
ms0m=1e6;?%?margin
ms0=zeros(ms0m1‘int32‘);?%?predifined?array?to?increase?speed
ms0L=0;?%?0?points?initially

%?initial?point?color:
R0=R(r(2)r(1));
G0=G(r(2)r(1));
B0=B(r(2)r(1));

%?to?pixel?number
tn=@(xxyy)?yy+szy*(xx-1);


while?true;
????%?get?seed?from?stack:
????xt=st(stL1);
????yt=st(stL2);
????stL=stL-1;
????
????%?line:
????%?to?right
????sku=false;?%?seed?key?true?if?seed?added?up
????skd=false;?%?same?for?down
????sku1=false;?%?this?key?is?need?to?prewnt?extra?seed?when?move?to?left?up
????skd1=false;?%?same?for?left
????for?xtt=xt:szx
????????
????????if?max(abs([(R(ytxtt)-R0)?(G(ytxtt)-G0)?(B(ytxtt)-B0)]))<=tol
????????????%?add?pixel
????????????ms0L=ms0L+1;
????????????ms0(ms0L)=tn(xttyt);
????????else
????????????break;
????????end
????????
????????%?try?to?add?seed?up:
????????if?yt~=szy
????????????if?max(abs([(R(yt+1xtt)-R0)?(G(yt+1xtt)-G0)?(B(yt+1xtt)-B0)]))<=tol
????????????????if?~sku
????????????????????if?all(tn(xttyt+1)~=ms0(1:ms0L))?%?if?free?space
????????????????????????%?add?to?stack
????????????????????????stL=stL+1;
????????????????????????st(stL1)=xtt;
????????????????????????st(stL2)=yt+1;
????????????????????????sku=true;
????????????????????end
????????????????end
????????????else
????????????????sku=false;
????????????end
????????????if?xtt==xt
????????????????sku1=sku;?%?memorize?will?be?used?when?to?left
????????????end
????????end
????????
????????%?try?to?add?down
????????if?yt~=1
????????????if?max(abs([(R(yt-1xtt)-R0)?(G(yt-1xtt)-G0)?(B(yt-1xtt)-B0)]))<=tol
????????????????if?~skd
????????????????????if?all(tn(xttyt-1)~=ms0(1:ms0L))?%?if?free?space
????????????????????????%?add?to?stack
????????????????????????stL=stL+1;
????????????????????????st(stL1)=xtt;
????????????????????????st(stL2)=yt-1;
????????????????????????skd=true;
????????????????????end
????????????????end
????????????else
????????????????skd=false;
????????????end
????????????if?xtt==xt
????????????????skd1=skd;?%?memorize?will?be?used?when?to?left
????????????end
????????end
????end
????
????%?to?left
????%sku=false;?%?seed?key?true?if?seed?added
????%skd=false;
????sku=sku1;
????skd=skd1;
????if?xt~=1
????????for?xtt=(xt-1):-1:1?

????????????if?max(abs([(R(ytxtt)-R0)?(G(ytxtt)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????19264??2010-09-15?01:01??explane.png
?????文件????????4628??2010-09-15?14:47??flood_fill.m
?????文件?????????590??2010-09-04?00:40??smile.png
?????文件????????5372??2010-09-15?01:53??zz_flood_fill_movie.m
?????文件?????????411??2010-09-15?14:48??zz_flood_fill_test.m
?????文件?????????210??2010-09-15?01:18??zz_flood_fill_test_movie.m
?????文件????????1532??2014-02-12?13:15??license.txt

評論

共有 條評論