First time here? Check out the FAQ!
answered 2016-10-04 17:34:53 -0600
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.