img_augmentation.py 文件源码

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

项目:lasagne_CNN_framework 作者: woshialex 项目源码 文件源码
def build_center_uncenter_transforms(image_shape):
    """
    These are used to ensure that zooming and rotation happens around the center of the image.
    Use these transforms to center and uncenter the image around such a transform.
    """
    center_shift = np.array([image_shape[1], image_shape[0]]) / 2.0 - 0.5 # need to swap rows and cols here apparently! confusing!
    tform_uncenter = skimage.transform.SimilarityTransform(translation=-center_shift)
    tform_center = skimage.transform.SimilarityTransform(translation=center_shift)
    return tform_center, tform_uncenter
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号