def compute_average(imlist):
 averageim = array(Image.open(imlist[0]), 'f')
 skipped = 0
 for imname in imlist[1:]:
  try:
   averageim += array(Image.open(imname))
  except:
   print (imname + '...skipped')
   skipped += 1
 averageim /= (len(imlist) - skipped)
 return array(averageim, 'uint8')

def compute_average ( imlist ) : averageim = array ( Image . open ( imlist [ 0 ] ) , 'f' ) skipped = 0 for imname in imlist [ 1 : ] : try : averageim += array ( Image . open ( imname ) ) except : print ( imname + '...skipped' ) skipped += 1 averageim /= ( len ( imlist ) - skipped ) return array ( averageim , 'uint8' )
compute the average of a list of images .