def transparent_image_overlay(pos, overlay_img, img, alpha):
 roi = (slice(pos[1], (pos[1] + overlay_img.shape[0])), slice(pos[0], (pos[0] + overlay_img.shape[1])))
 try:
  cv2.addWeighted(overlay_img, alpha, img[roi], (1.0 - alpha), 0, img[roi])
 except:
  logger.debug('transparent_image_overlay was outside of the world image and was not drawn')
 pass

def transparent_image_overlay ( pos , overlay_img , img , alpha ) : roi = ( slice ( pos [ 1 ] , ( pos [ 1 ] + overlay_img . shape [ 0 ] ) ) , slice ( pos [ 0 ] , ( pos [ 0 ] + overlay_img . shape [ 1 ] ) ) ) try : cv2 . addWeighted ( overlay_img , alpha , img [ roi ] , ( 1.0 - alpha ) , 0 , img [ roi ] ) except : logger . debug ( 'transparent_image_overlay was outside of the world image and was not drawn' ) pass
overlay one image with another with alpha blending in player this will be used to overlay the eye over the world image arguments: pos: position of the top left corner in numpy row .