Ask Your Question
0

Analyze images in group of 10

asked 2016-10-04 14:59:53 -0600

DT0311 gravatar image

Hi, I am currently using this function for image averaging:

cv::Mat avgImg;
avgImg.create(width, height,CV_32FC3);

for(i = 1; i <= N; i++){
  image = imread(fileName.c_str(),0);
  cv::accumulate(image, avgImg);
}

avgImg = avgImg / N;

After this, instead of taking average of all images, I wish to take the average of several groups of 10 images. For example, average of image_1 to image_10, then average of image_11 to image_20 and so on. Is there a function that allows for this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-10-04 17:34:53 -0600

Tetragramm gravatar image

Well, at the end of each 10, save a copy of avgImg to whatever data structure is holding your averages, then set avgImg to zero.

No need for anything special.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-10-04 14:59:53 -0600

Seen: 119 times

Last updated: Oct 04 '16