MATLAB: Registration of two images i done but it required more execution time, please provide another code

image regstration

% Image Registration
clc;
clear all;
close all;
fixed = imread('high.jpg');
% figure(),imshow(fixed);
moving = imread('low.jpg');
figure, imshowpair(moving, fixed, 'montage')
title('Unregistered');
[optimizer,metric] = imregconfig('multimodal');
movingRegisteredDefault = imregister(moving, fixed, 'affine', optimizer, metric);
% % figure, imshowpair(movingRegisteredDefault, fixed);
% title('A: Default registration');
% disp(optimizer);
% disp(metric);
optimizer.InitialRadius = optimizer.InitialRadius/3.5;
movingRegisteredAdjustedInitialRadius = imregister(moving, fixed, 'affine', optimizer, metric);
% figure, imshowpair(movingRegisteredAdjustedInitialRadius, fixed);
% title('Adjusted InitialRadius');
optimizer.MaximumIterations = 300;
movingRegisteredAdjustedInitialRadius300 = imregister(moving, fixed, 'affine', optimizer, metric);
% figure, imshowpair(movingRegisteredAdjustedInitialRadius300, fixed)
% title('B: Adjusted InitialRadius, MaximumIterations = 300, Adjusted InitialRadius.');
tformSimilarity = imregtform(moving,fixed,'similarity',optimizer,metric);
Rfixed = imref2d(size(fixed));
movingRegisteredRigid = imwarp(moving,tformSimilarity,'OutputView',Rfixed);
% figure, imshowpair(movingRegisteredRigid, fixed);
tformSimilarity.T
movingRegisteredAffineWithIC = imregister(moving,fixed,'affine',optimizer,metric,...
'InitialTransformation',tformSimilarity);
figure(),
imshowpair(movingRegisteredAffineWithIC, fixed)
imwrite(movingRegisteredAffineWithIC,'Regi.jpg');

Best Answer

  • There are lots of registration routines offered on the File Exchange that you could browse,