資源簡介
通過MATLAB仿真實現規則圖片與不規則圖片的拼接復原工作。源自--華清
代碼片段和文件信息
clear?all
close?all
clc
A=imread(‘E:\B\附件1\000.bmp‘);
figureimshow(A)
title(‘源圖像‘);
B=imread(‘E:\B\附件1\001.bmp‘);
[highwid]=size(A);
A1=double(A);
B1=double(B);
B2=B1;
A2=A1;
sub_A=A1(high/2-39:high/23*wid/4:3*wid/+39);
sub_A=A1(high/2-39:high/2end-39:end);
sub_B1=B1(11:5011:50);
mod1=sub_A-sub_B1;
mat1=sum(sum(mod1.*mod1));
mat_best=mat1;
for?x1=1:40:wid-20
????for?y1=1:40:high-40
????????sub_B=B1(y1:y1+39x1:x1+39);
????????mod=sub_A-sub_B;
????????mat=sum(sum(mod.*mod));
????????if?mat<=mat_best
????????????mat_best=mat;
????????????xx=x1;
????????????yy=y1;
????????end
????end
end
x=xx;
y=yy;
for?x2=xx-30:xx+40
????for?y2=yy-20:yy+80
???
- 上一篇:pda 概率數據關聯
- 下一篇:3dmax批量處理貼圖文件路徑字符
評論
共有 條評論