Can I overlay a large number of image?

3 views (last 30 days)
Hi all,
Beginner matlaber here, looking for some advice. I have a series of frames from a video showing an oscilating object. What I'd like to do is overlay all of them. I have used imfuse to overlap two of them but I'm wondring how I would start overlaying 500 images. I also wonder if just summing the image as matrices of data would be better? The frame are .tif and are all the same size.
A few pointers or push in the right direction would be much appriecated.
Cheers,
Sam

Answers (1)

Constantino Carlos Reyes-Aldasoro
Hello
You can always overlay things by summing them, say your data is a 3D stack and each layer is one of your frames,
a = zeros(50,50,6);
a(1:10,1:10,1) = 1;
a(11:20,11:20,2) = 1.2;
a(31:40,1:10,3) = 0.8;
a(1:10,31:40,4) = 2;
a(41:50,1:10,5) = 3;
a(1:10,41:50,6) = 0.5;
% add a line to show where each frame is
a(1:3,:,:)=0.5;
a(:,1:3,:)=0.5;
montage(a)
Now, I can add all the frames and show together
imagesc(sum(a,3));
colormap gray

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!