utils.py 文件源码

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

项目:convnet-for-geometric-matching 作者: hjweide 项目源码 文件源码
def crop_transform(img, params):

    # take the center crop of the original image as I_{A}
    crop = center_crop(img, 227)

    M, = generate_transformations(
        1, (img.shape[0], img.shape[1]), **params
    )

    # apply T_{\theta_{GT}} to I_{A} to get I_{B}
    warp = cv2.warpAffine(
        crop.astype(np.float32), M[:2], (crop.shape[1], crop.shape[0]),
        flags=cv2.INTER_LINEAR, borderMode=cv2.BORDER_REFLECT_101
    )

    return crop, warp, M
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号