Summing all pixels in frames and plotting them against different stacks?

3 views (last 30 days)
Hi all,
Having trouble summing pixels in for different stacks. I've taken around 20 stacks with 100 frames each of an image of size 1200x1200. These stacks vary with light the first being dark and the last the camera is saturated.. From all of these stacks I need to subtract an image in complete darkness (no photons)(darkimageformfiles). I would like to sum all my pixels in the image for all 100 frames for each of the stacks then plot the log(mean) of these stacks against the log(standard deviation) of the same stack. At the moment I have code to plot this graph for 1 pixel for each of the stacks. But I'm having trouble plotting for many pixels for each of the stacks. I ulitmately want the average mean and std for all the pixels in the image which vary with the stacks. Any help would be greatly appreciated. The code I have already is below.
dark_data = 'darkimagefromfiles';
info = imfinfo(dark_data);
numberofimages = length(info);
for d = 1:numberofimages
darkStack(:,:,d)= double(imread(dark_data, d));
mean_dark_stack = mean(darkStack,3);
for R =1:length(director)
d_file_name =strcat(director(R).folder,'\',director(R).name);
listing = dir(d_file_name);
current_file = strcat(d_file_name,'\',listing(3).name);
info_current = imfinfo(current_file);
for d = 1:numberofimages
current(:,:,d)= double(imread(current_file, d));
current = current - mean_dark_stack;
mean_data_set(:,:,R) = mean(current,3);
std_data_set(:,:,R) = std(current,1,3);
var_data_set(:,:,R) = var(current,1,3);

Answers (0)


Community Treasure Hunt

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

Start Hunting!