Convert

PIL2npArr

def PIL2npArr(pil_img):

“”” Convert Pillow image to numpy array.

“”“

Bool2Uint8

def Bool2Uint8(bool_img):

“”” Convert bool image to dtype uint8.

“”“

Binary2Bool

def Binary2Bool(bin_img):

“”” Convert binary image to dtype bool.

“”“