多焦距MI配准与小波融合

1.输入数据

多焦距MI配准与小波融合_第1张图片

2.Matlab代码

clc
clear
close all;

%%
%实现多焦距图像配准与融合

%%
%1.read image
fixedPath = '1.jpg';
movePath = '2.jpg';
fixed = imread(fixedPath);
moving = imread(movePath);
if ndims(fixed)==3
    fixed = rgb2gray(fixed);
end
if ndims(moving)==3
    moving = rgb2gray(moving);
end
% figure, imshow(fixed),impixelinfo;
% figure, imshow(moving),impixelinfo;
figure, imshowpair(moving, fixed, 'Scaling','joint');
title('Not Registered');
%%
%2.register by MI
t1=clock;
[optimizer, metric] = imregconfig('multimodal');
optimizer.InitialRadius = 0.009;
optimizer.Epsilon = 1.5e-4;
optimizer.GrowthFactor = 1.01;
optimizer.MaximumIterations = 300;
movingRegistered = imregister(moving, fixed, 'affine', optimizer, metric);
t2=clock;
disp(etime(t2,t1));
figure
imshowpair(fixed, movingRegistered,'Scaling','joint');
title('Registered');
%%
%3.图像融合
XFUS = wfusimg(fixed,movingRegistered,'sym4',5,'max','max');
%归一化
XFUS = uint8(((XFUS - min(min(XFUS)))/(max(max(XFUS)) - min(min(XFUS))))*255);
figure,imshow(XFUS);
title('ImageFuse');

3.配准结果

多焦距MI配准与小波融合_第2张图片多焦距MI配准与小波融合_第3张图片

你可能感兴趣的:(图像配准)