imutils.py 文件源码

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

项目:VLTPF 作者: avigan 项目源码 文件源码
def _rotate_interp_builtin(array, alpha, center, mode='constant', cval=0):
    '''
    Rotation with the built-in rotation function.

    The center of rotation is exactly ((dimx-1) / 2, (dimy-1) / 2),
    whatever the odd/even-ity of the image dimensions

    '''
    alpha_rad = -np.deg2rad(alpha)

    # center of rotation: ((dims[1]-1) / 2, (dims[0]-1) / 2)
    rotated = ndimage.interpolation.rotate(array, np.rad2deg(-alpha_rad), reshape=False, order=3, mode=mode, cval=cval)

    return rotated
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号