You don't need to initialize a black image every time. cv2 returns an image, so anyway it's getting written over.