How can I register a series of images stored in an array with imregister?

2 views (last 30 days)
geog170
geog170 on 7 Jun 2018
Commented: PEIYU LIM on 15 Apr 2019
I have a series of 1200 images stored in a 512 x 640 x 1200 array (Tir_telops_rot). I need to register these images before I can analyze them for my research. They were all taken from the same infrared camera but there was swaying movement of the platform during acquisition. I can successfully use imregister for two images, but I am having issues when apply it to a series in my code below. Using the code I've written, the resulting array (Tir_telops_reg) is a series of just the same image repeated 1200 times, instead of each of the newly registered images. Does anyone know how to rewrite the line that writes the Tir_telops_reg array so it correctly stores each image? Thanks for the help!
fixed = Tir_telops_rot(:,:,1); %reference image
[optimizer, metric] = imregconfig('monomodal');
for i=512
for j=640
for k=1:1200
moving = Tir_telops_rot(i,j,k); %This may be wrong, it needs to be written so each iteration (k) looks at the next image as the moving one
movingRegistered = imregister(moving, fixed, 'translation', optimizer, metric);
Tir_telops_reg(i,j,k)=movingRegistered(k); %I believe my issues are in this line
end
end
end

Answers (1)

Arun Mathamkode
Arun Mathamkode on 12 Jun 2018
You need not loop through individual pixels for image registration. Since image registration is a global transform, you can directly pass the entire image to imregister.
fixed = Tir_telops_rot(:,:,1); %reference image
[optimizer, metric] = imregconfig('monomodal');
Tir_telops_reg= zeros(size(Tir_telops_rot));
for k=1:1200
moving = Tir_telops_rot(:,:,k);
Tir_telops_reg(:,:,k) = imregister(moving, fixed, 'translation', optimizer, metric);
end

Community Treasure Hunt

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

Start Hunting!