adding pixels of each binary image in time series

Ravindra · Feb 19, 2022 · 1.9K views
Question
I have time series of classified binary images with same number of rows and columns, I would like to add the values for each cell (eg. (1,1)) of every image. then divide addition for a cell with number of images to get percentage.   idea is to get the percentage for each cell in this time series 1.tif, 2.tif,......10.tif   then plot this percentage for each cell on a 3D graph with varying colors.   hints or suggestions will be helpful. Thanks in advance!!
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Sep 12, 2026

Inside the loop over images,

 

if k == 1
  % It's the first image.  Create the sum image.
  sumImage = double(binaryImage);
else
  % It's the second or later.  Add it.
  sumImage = sumImage + double(binaryImage);
end

Then after the loop divide sumImage by the number of images to get the percentage image.

percentageImage = 100 * sumImage / numberOfImages;
imshow(percentageImage, []); % Display scaled to 0-255 with the [] option.

 

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!