Home > Software engineering >  Matlab image registration correction
Matlab image registration correction

Time:11-08

The function of Q=Peizhun (I, J)
I=imread (' cross1. JPG);
J=imread (' cross2. JPG);
If isrgb (I)
I1=rgb2gray (I);
The else
I1=I;
End
If isrgb (J)
J1=rgb2gray (J);
The else J1=J;
End
I=double (I1);
J=double (J1);
TicRegistrationParameters=Powell (I, J);
TocElapsedTime=toc;
X=RegistrationParameters (1);
Y=RegistrationParameters (2);
Ang=RegistrationParameters (3);
MI_Value=https://bbs.csdn.net/topics/RegistrationParameters (4);
RegistrationResult=sprintf (' X, Y, Angle=[%. 5 f] [%. 5 f] [%. 5 f] ', X, Y, ang)
MI_Value=https://bbs.csdn.net/topics/sprintf (' MI_Value=https://bbs.csdn.net/topics/[% 4 f] ', MI_Value)
X=round (X);
Y=round (Y);
Ang=round (Ang);
Se=translate (strel (1), (X, Y));
J2=imdilate (J1, se);
(J2, J3=imrotate Ang, 'on', 'crop'); % [FusionImage RegistrationImage]=Fusion (x, y, ang, I, J); % imshow (FusionImage) [FusionImage]=Fus (I1, J3);
figure(1);
Imshow (I1);
The title (" Base image ");
figure(2);
Imshow (J1);
The title (' Float image ');
figure(3);
Imshow (J3);
The title (' Trans image ');
figure(4);
Imshow (FusionImage);
The title (' Registration image ');
  • Related