augmentation.py 文件源码

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

项目:phocnet 作者: ssudholt 项目源码 文件源码
def translate_image(image, translation):
        '''
        Translates the given image with the given translation vector.
        '''

        rows, cols, _ = np.atleast_3d(image).shape
        trans_mat = np.array([[1, 0, translation[0]*cols], [0, 1, translation[1]*rows]])

        return cv2.warpAffine(image, trans_mat, (cols, rows))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号