How to register and average images together from a mat file

2 views (last 30 days)
I was given a mat file that contains a collection of shifted frames. I need to figure out how to register the shifted frames and average them together. I am pretty unfamiliar with this side of matlab so I don't really know where to begin, any help would be appreciated.
I have attached the mat file and the jpeg.

Answers (1)

Kevin Holly
Kevin Holly on 29 Nov 2021
yanqi liu
yanqi liu on 30 Nov 2021
yes,sir,may be use moving matrix,such as
close all
load( 'undergraduate_data.mat' ); % 125-by-125-by-30
[optimizer, metric] = imregconfig('monomodal');
% Assuming first image is fixed
new = photoshift;
for index = 2:1:size(photoshift, 3)
imagesc(photoshift(:, :, index)); grid on; daspect( [1 1 1] );drawnow
% use now photoshift and last new
new(:,:,index) = imregister(photoshift(:, :, index),new(:,:,index-1),"affine",optimizer, metric);
imagesc(new(:, :, index)); grid on; daspect( [1 1 1] );drawnow
average_new = mean(new,3);
figure; imshow(average_new,[]);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!