Register high resolution images using geometric transform obtained from same images of low resolution.

1 view (last 30 days)
So I have registered two images perfectly and used imwarp to get it in its RGB format.These are low resolution images (456*417*3) uint8 and both have same size.
Now the problem arises when I try to use the tform (geometric transformation)obtained by these two low resolution images and I pass that in imwarp function to align the high resolution or scaled up version of the same two images(size 7425x6657x3) uint8.They remain misaligned when I view them using imshowpair and scaling property.
IM1 and IM2 are low resolution images and IM11 and IM22 are high resolution images.
I am using this method to reduce my computation time as registering the high resolution image takes a lot of time.So registering at low resolution and applying that transform to high resolution using imwarp should I guess take less computation time.
Here is my code.
function [ M_Reg Reg_IM1 ,movingRegistered]=fun_Register(IM1,IM2,IM11,IM22) % function [M_Reg Reg_IM1 movingRegistered]=fun_Register(IM1,IM2) Reg_IM1=rgb2gray(IM1); Reg_IM2=rgb2gray(IM2); figure, imshowpair(Reg_IM1,Reg_IM2,'ColorChannels',[1 2 0])
%% Define Optimizer and Metric parameters
optimizer = registration.optimizer.OnePlusOneEvolutionary; metric = registration.metric.MeanSquares;
%%Tuning optimizer parameters to improve registration effiency optimizer.InitialRadius=0.0001; optimizer.MaximumIterations = 1000;
%%Registration using Similarity value M_Reg = imregister(Reg_IM2,Reg_IM1, 'affine', optimizer, metric,'DisplayOptimization',true); figure,imshowpair(Reg_IM1,M_Reg, 'Scaling','joint');title('Final registered diffrence')
%%Estimate geometric transformation that aligns two tform = imregtform(Reg_IM2,Reg_IM1,'affine',optimizer,metric);
%%Apply geometric transformation to image movingRegistered = imwarp(IM22,tform,'OutputView',imref2d(size(IM11)));
%Display results
figure,imshow(movingRegistered);title('Registered Image High Resolution')
figure,imshowpair(IM11,movingRegistered, 'Scaling','joint');title('Final registered 1')
Any help will be deeply appreciated!!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!