def _changeArrayDType(img, dtype, **kwargs):
if dtype == 'noUint':
return toNoUintArray(img)
if issubclass(np.dtype(dtype).type, np.integer):
return toUIntArray(img, dtype, **kwargs)
return img.astype(dtype)
# def bitDepth(path, img=None):
# '''
# there are no python filetypes between 8bit and 16 bit
# so, to find out whether an image is 12 or 14 bit resolved
# we need to check actual file size and image shape
# '''
# if img is None:
# img = imread(img)
# size = os.path.getsize(path)*8
# print (size, img.size,8888888,img.shape, size/img.size)
# kh
# return size/img.size
评论列表
文章目录