augment.py 文件源码

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

项目:cnn-traffic-light-evaluation 作者: takeitallsource 项目源码 文件源码
def rotate(image, angles=DEFAULT_ANGLES):
    rotated = []

    for angle in angles:
        center = tuple(np.array(image.shape[:2]) / 2)
        R = cv2.getRotationMatrix2D(center, angle, 1.0)
        rotated_image = cv2.warpAffine(image, R, image.shape[:2], flags=cv2.INTER_CUBIC)
        rotated.append(rotated_image)

    return rotated
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号