image_utils.py 文件源码

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

项目:pybot 作者: spillai 项目源码 文件源码
def im_resize(im, shape=None, scale=0.5, interpolation=cv2.INTER_AREA): 
    if shape is not None: 
        return cv2.resize(im, dsize=shape, fx=0., fy=0., interpolation=interpolation)
    else:
        if np.fabs(scale-1.0) < 1e-2: 
            return im
        elif scale <= 1.0: 
            return cv2.resize(im, None, fx=scale, fy=scale, interpolation=interpolation)
        else: 
            shape = (int(im.shape[1]*scale), int(im.shape[0]*scale))
            return im_resize(im, shape)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号