How to find an average of multiple images?
Afficher commentaires plus anciens
Hi,
I'm trying to get an averaged array of several images. Here's a part of the code I've written:
im=cell(1,length(filenames));
for n=1:length(filenames)
filename=filenames{n};
FullFileName=[pathname,filename];
im{n} = imread(FullFileName);
%figure,imshow(im{n})
end
I want to find a linear combination of all im{} and then find the average, I tried:
Z=imlincomb(1,im{1},1,im{2},1,im{3},...
1,im{n},'uint16');%finds a linear combination of image arrays but only for 4 images,even if I select more
X=imdivide(Z,n); %finds the average
Y=uint8(X); %returns type to 'uint8'
figure, imshow(Y)
The main problem is to get imlincomb to include all the im{}. Is there any way of doing that?
Thanks in advance.
Sofya
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!