## Average of 10 images

Soum

### Soum (view profile)

님이 질문을 제출함. 14 Jul 2013
최근 활동 lateef oparemi

### lateef oparemi (view profile)

님이 답변함. 6 Jun 2019
Hi;
I read a series of images and I want to calculate their average I've written
this code :
I=zeros(size(Io))
for i=1:10
I=I+image{i}
end;
I=I./10;
am I right ? knowing that it gives a result

로그인 to comment.

## 답변 수: 2

### Image Analyst (view profile)

on 14 Jul 2013

No, it's not. For one thing, don't use image as the name of a variable since it's the name of a built-in function. And no reason to store them all and use a cell array.
sumImage = double(I0); % Inialize to first image.
for i=2:10 % Read in remaining images.
sumImage = sumImage + double(rgbImage);
end;
meanImage = sumImage / 10;

표시 이전 댓글 수: 1
Image Analyst

### Image Analyst (view profile)

on 13 Sep 2017
The images must be in slightly different positions, despite you thinking they aren't. The way around it is to call imregister() to align the images before summing.
CS

### CS (view profile)

on 21 Nov 2018
and how can we do that? put imregister() before the imread?
By the way i was trying to find moving object so i thought of finding the background and then subtract, do you know a better way to do that?
Walter Roberson

### Walter Roberson (view profile)

on 21 Nov 2018
You need a base image such aas the first in the series . Then after every imread you would register the new image against the base image and add in the aligned version of the new image .

로그인 to comment.

### lateef oparemi (view profile)

on 6 Jun 2019

sumImage = double(I0); % Inialize to first image.
for i=2:10 % Read in remaining images.