imgIO.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:imgProcessor 作者: radjkarl 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号