資源簡(jiǎn)介
2013全國大學(xué)生數(shù)學(xué)建模大賽B題第2問(附件2)碎紙還原程序 有附件原圖,效果圖,matlab程序?qū)崿F(xiàn)的代碼
代碼片段和文件信息
clear?close?all
m=0;
n=0;
js=1;
t_left=0;
t_right=0;
image_all=cell(118);
files=dir(‘*.bmp‘);
for?i=1:size(files1)?%批量讀取
???filename=files(i1).name;
???imfile=strcat(‘‘‘\‘filename);
???I?=?imread(imfile);
???I_bw=im2bw(I0.5);
???I1=imcomplement(I_bw);
??
?%?imtool(I_bw1);
??[ab]=size(I);
??m=a;
??n=n+b;
??temp_left=I1(:1);
??temp_right=I1(:end);
??t_left(1:ajs)=temp_left;
??t_right(1:ajs)=temp_right;
??image_all{i}=I;
??js=js+1;
end
image_final=zeros(mn);
t=mean(t_left);
posi_left=find(t==0);
image_final(:1:b)=image_all{posi_left};
t_left(:posi_left)=0;
t=mean(t_right);
posi_right=find(t==0);
image_final(:n-b+1:n)=image_all{posi_right};
t_right(:posi_right)=0;
d=1;
start_t=t_right(:posi_left);
for?k=1:19
????for?k1=1:19
????????t1=t_left(:k1);
????????z(k1)=corr(start_tt1);
????end
[zindex_posi]=max(z);
start_t=t_right(:index_posi);
t_left(:index_posi)=0;
if?t_right(:index_posi)==t_right(:posi_right);
????brea
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-10-17?17:22??附件2\
?????文件??????143638??2013-07-20?20:43??附件2\000.bmp
?????文件??????143638??2013-07-20?20:43??附件2\001.bmp
?????文件??????143638??2013-07-20?20:43??附件2\002.bmp
?????文件??????143638??2013-07-20?20:43??附件2\003.bmp
?????文件??????143638??2013-07-20?20:43??附件2\004.bmp
?????文件??????143638??2013-07-20?20:43??附件2\005.bmp
?????文件??????143638??2013-07-20?20:43??附件2\006.bmp
?????文件??????143638??2013-07-20?20:43??附件2\007.bmp
?????文件??????143638??2013-07-20?20:43??附件2\008.bmp
?????文件??????143638??2013-07-20?20:43??附件2\009.bmp
?????文件??????143638??2013-07-20?20:43??附件2\010.bmp
?????文件??????143638??2013-07-20?20:43??附件2\011.bmp
?????文件??????143638??2013-07-20?20:43??附件2\012.bmp
?????文件??????143638??2013-07-20?20:43??附件2\013.bmp
?????文件??????143638??2013-07-20?20:43??附件2\014.bmp
?????文件??????143638??2013-07-20?20:43??附件2\015.bmp
?????文件??????143638??2013-07-20?20:43??附件2\016.bmp
?????文件??????143638??2013-07-20?20:43??附件2\017.bmp
?????文件??????143638??2013-07-20?20:43??附件2\018.bmp
?????文件????????1253??2013-09-14?11:07??附件2\image_cut.m
?????目錄???????????0??2013-10-17?17:22??附件2\結(jié)果預(yù)覽\
?????文件??????473336??2013-10-17?17:21??附件2\結(jié)果預(yù)覽\finalimage.jpg
評(píng)論
共有 條評(píng)論