First convert the images to floats. You have N = 100 images. Imagine that a single image is an array of average pixel values ββover 1 image. You need to calculate an array of average pixel values ββfor N images.
Let A be an array of average pixel values ββof X images, B be an array of average pixel values ββof Y images. Then C = (A * X + B * Y) / (X + Y) is an array of average pixel values ββof X + Y images. To increase the accuracy of floating point operations, X and Y should be approximately equal
You can combine all your images, such as subarrays, into merge sort . In this case, the merge operation C = (A * X + B * Y) / (X + Y) , where A and B are arrays of average values ββof pixels X and Y images
source share