• 大小: 6KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-11
  • 语言: Matlab
  • 标签: 图像配准  

资源简介

INSAR图像配准实例matlab

资源截图

代码片段和文件信息

%融合图像
function [FusionImageRegistrationImage]=Fusion(handles)
%%%%%%%%%%%%%%%%%%%获取原图像及配准参数%%%%%%%%%%%%%%%%%%%
I=handles.Old_I;
J=handles.Old_J;
x=handles.RegistrationParameters(1);
y=handles.RegistrationParameters(2);
ang=-handles.RegistrationParameters(3);
%%%%%%%%%%%%%%%%对浮动图像空间变换及插值,以便得到配准后的输出图像%%%%%%%%%
[nrowsncols]=size(J);
width=nrows;
height=ncols;
new_J=uint8(zeros(widthheight));

a=(width-1)/2;
c=a;
b=(height-1)/2;
d=b;

rad=pi/180*ang;
t1=[1 0 0;0 1 0;x y 1];
t2=[1 0 0;0 1 0;-a -b 1];
t3=[cos(rad) -sin(rad) 0;sin(rad) cos(rad) 0;0 0 1];
t4=[1 0 0;0 1 0;c d 1];
T=t2*t3*t4*t1;
tform=makeform(‘affine‘T);

tx=zeros(widthheight);
ty=zeros(widthheight);
for i=1:width
    for j=1:height
        tx(ij)=i;
    end
end
for i=1:width
    for j=1:height
        ty(ij)=j;
    end
end
[w z]=tforminv(tformtxty);

for i=1:width
    for j=1:height
        source_x=w(ij);
        source_y=z(ij);
        if (source_x>=width-1||source_y>=height-1||...
                double(uint16(source_x))<=0||...
                double(uint16(source_y))<=0)
            new_J(ij)=J(11);
        else
            if (source_x/double(uint16(source_x))==1.0)&...
                    (source_y/double(uint16(source_y))==1.0)
                new_J(ij)=J(int16(source_x)int16(source_y));
            else
                %a=double(round(source_x));
                %b=double(round(source_y));
                %new_J(des_xdes_y)=J(ab);
                a=double(uint16(source_x));
                b=double(uint16(source_y));
                x11=double(J(ab));
                x12=double(J(ab+1));
                x21=double(J(a+1b));
                x22=double(J(a+1b+1));
                new_J(ij)=uint8((b+1-source_y)*((sourec_x-a)*x21+...
                    (a+1-sourec_x)*x11)+(source_y-b)*((source_x-a)*x22...
                    +(a+1-source_x)*x12));
            end
        end
    end
end
J=new_J;

I=uint8(I);
J=uint8(J);
RegistrationImage=uint8(J);

%%%%%%%%%%%%%%%%%%%%产生“融合”后的效果图%%%%%%%%%%%%%%%%%%%%%%
I=double(I)/255;
J=double(J)/255;
IJ=double(zeros(widthheight));
for m=1:width
    for n=1:height
        if I(mn)>0.999||J(mn)>0.999
            IJ(mn)=0.8;
        elseif I(mn)==0||J(mn)==0
            IJ(mn)=0.01;
        else
            IJ(mn)=(I(mn)*0.3+J(mn)*0.7);
        end
    end
end
IJ=IJ*255;
IJ=uint8(IJ);
FusionImage=IJ;




 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2521  2011-08-15 00:55  8 图像配准实例\Fusion.m

     文件        516  2011-08-15 00:55  8 图像配准实例\GLPF.m

     文件       4235  2011-08-15 00:55  8 图像配准实例\ImageRegistration.m

     文件        707  2011-08-15 00:55  8 图像配准实例\OneDimensionSearch.m

     文件       4002  2011-08-15 00:55  8 图像配准实例\OpenImage.m

     文件       1008  2011-08-15 00:55  8 图像配准实例\Powell.m

     文件       2159  2011-08-15 00:55  8 图像配准实例\PV.m

     文件         87  2011-08-15 00:55  8 图像配准实例\Test.m

     目录          0  2016-06-02 23:23  8 图像配准实例

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

                15235                    9


评论

共有 条评论