normalize.py 文件源码

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

项目:nimo 作者: wolfram2012 项目源码 文件源码
def selfQuotientImage(matrix,sigma=5.0):
    '''
    Compute a self quotient image.

    Based on work by Wang et.al. "Self Quotient Image for Face Recognition" ICIP 2004
    '''
    is_image = False
    if isinstance(matrix,pv.Image):
        matrix = matrix.asMatrix2D()
        is_image = True

    assert matrix.min() >= 0 
    matrix = matrix + 0.01*matrix.max()
    denom = ndi.gaussian_filter(matrix,sigma)

    # make sure there are no divide by zeros
    matrix = matrix/denom

    if is_image:
        return pv.Image(matrix)
    return matrix
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号