### Mean

For each pixel in the image, calculate its red, green and blue mean

using the first 100 frames

redAvg=zeros(height,width); greenAvg=zeros(height,width);

blueAvg=zeros(height,width);

redAvg(:,:)= a(1,1).cdata(:,:,1); %initial values, redAvg is an array

greenAvg(:,:)= a(1,1).cdata(:,:,2);%initial values, greenAvg is an array

blueAvg(:,:)= a(1,1).cdata(:,:,3);%initial values, blueAvg is an array

numberFrames = 100;

for i=2:100 %process 100 images for mean, first frame in initial array from above

for k=1:width

for j=1:height

redAvg(j,k)= redAvg(j,k)+double(a(1,i).cdata(j,k,1));

greenAvg(j,k)= greenAvg(j,k)+double(a(1,i).cdata(j,k,2));

blueAvg(j,k)= blueAvg(j,k)+double(a(1,i).cdata(j,k,3));

end

end

end

redAvg=redAvg/numberFrames;

greenAvg=greenAvg/numberFrames;

blueAvg=blueAvg/numberFrames;

Roger S. Gaborski