MATLAB: Average image of set of image

average image

i want to input multiple images with different size from a folder and then find the average image of those images? i try this code but it didn't give me any thing
imgSet=imageSet('C:\Users\User\Desktop\Jamila\master2Project\segmentationArticles\shapes');
nBand=1;
meanEachImage=arrayfun(@(x) mean(reshape(imgSet.read(x),[],nBand)), (1:imgSet.Count)','UniformOutput',false);
meanImages=mean(cell2mat(meanEachImage));
% imshow(meanImages,[]);
meanImages = uint8(meanImages);
imshow(meanImages,[]); % [] is optional now.

Best Answer

See attached demo for averaging a bunch of images.