How to register and average images together from a mat file

조회 수: 3 (최근 30일)
Cameron Kreevich
Cameron Kreevich 2021년 11월 29일
댓글: yanqi liu 2021년 11월 30일
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.

답변 (1개)

Kevin Holly
Kevin Holly 2021년 11월 29일
  댓글 수: 7
Cameron Kreevich
Cameron Kreevich 2021년 11월 29일
편집: Cameron Kreevich 2021년 11월 29일
Yes i am assuming the 1st frame is fixed, with the above code the first figure displayed is the 20 framees and the one underneath is the frames averaged together correct?
yanqi liu
yanqi liu 2021년 11월 30일
yes,sir,may be use moving matrix,such as
clc
clear
close all
load( 'undergraduate_data.mat' ); % 125-by-125-by-30
[optimizer, metric] = imregconfig('monomodal');
% Assuming first image is fixed
new = photoshift;
figure
for index = 2:1:size(photoshift, 3)
subplot(2,1,1)
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);
subplot(2,1,2)
imagesc(new(:, :, index)); grid on; daspect( [1 1 1] );drawnow
pause(0.1)
end
average_new = mean(new,3);
figure; imshow(average_new,[]);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by