normalize.py 文件源码

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

项目:nimo 作者: wolfram2012 项目源码 文件源码
def highPassFilter(matrix,sigma):
    '''
    This function computes a high and low pass filter.  This can be used 
    to reduce the effect of lighting.

    A low pass image is first computed by convolving the image with a 
    Gausian filter of radius sigma.  Second, a high pass image is computed
    by subtracting the low pass image from the original image.  This means that 
    the original image can be reconstructed by adding a low pass image and a high
    pass image.

    @returns: high_pass_image
    '''
    is_image = False
    if isinstance(matrix,pv.Image):
        matrix = matrix.asMatrix2D()
        is_image = True

    matrix = matrix - ndi.gaussian_filter(matrix,sigma)

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


问题


面经


文章

微信
公众号

扫码关注公众号