ssd_batch_generator.py 文件源码

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

项目:ssd_keras 作者: pierluigiferrari 项目源码 文件源码
def _scale(image, min=0.9, max=1.1):
    '''
    Scale the input image by a random factor picked from a uniform distribution
    over [min, max].

    Returns:
        The scaled image, the associated warp matrix, and the scaling value.
    '''

    rows,cols,ch = image.shape

    #Randomly select a scaling factor from the range passed.
    scale = np.random.uniform(min, max)

    M = cv2.getRotationMatrix2D((cols/2,rows/2), 0, scale)
    return cv2.warpAffine(image, M, (cols, rows)), M, scale
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号