image.py 文件源码

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

项目:hdrnet_legacy 作者: mgharbi 项目源码 文件源码
def resize(input_image, size):
  dtype = input_image.dtype
  ret = skimage.transform.resize(input_image, size)
  if dtype == np.uint8:
    ret = (255*ret).astype(dtype)
  elif dtype == np.uint16:
    ret = (65535*ret).astype(dtype)
  elif dtype == np.float32 or dtype == np.float64:
    ret = ret.astype(dtype)
  else:
    raise ValueError('resize not implemented for type {}'.format(dtype))
  return ret


# ----- I/O -------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号