def loadImg(fn,enc,dtype='float'):
"""Loads image from filename fn with encoding enc and returns it as with given dtype.
Args:
fn (str): File path.
enc (str): Image encoding, e.g. 'uint16'.
Keyword Args:
dtype (str): Datatype of pixels of returned image.
Returns:
numpy.ndarray: Loaded image.
"""
#Load image
img = skimage.io.imread(fn).astype(enc)
#Getting img values
img=img.real
img=img.astype(dtype)
return img
评论列表
文章目录