From: Clement Guyot on
Hi all,

From a file with several pictures, I would like to calculate the intensity of each pictures, and make an average.

I can do it for one picture, but I don't manage to o it for several.

Thank you for you help

For one picture:
A = imread('test.bmp');
GrayImage = rgb2gray(A);
Intensity = sum(sum(GrayImage))

For several pictures , I wrote that but it doesn't work

thepath = 'c:\test';
filelist = dir(fullfile(thepath,'test*.bmp'));
fileNames ={filelist.name}'

for k=1:number of file;
I = imread(fileNames{k});

Intensity{k} = mean(sum(sum(I)));
end ...

Thank you again
From: ImageAnalyst on
Try Intensity(k) = mean(I(:));

or Intensity(k) = mean(mean(I));
From: Clement Guyot on
Thank you for your answer, and sorry for the late reply.
With mean, I have the mean of the pixel of one picture. I wanted to know the intensity of several picture, and make an average of it.

I solved my problem, so maybe it can be intersted for other people
Intensity(k) = sum(sum(I)); %instead of Intensity{k}
J = mean(Intensity) %average of the intensity of all the pictures

ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <4451d5ab-d7a4-4503-9710-8b5e6316fed9(a)h13g2000yqm.googlegroups.com>...
> Try Intensity(k) = mean(I(:));
>
> or Intensity(k) = mean(mean(I));