(img, size=3)
return l_var
Compute a image of the local variance
Compute a image of the local variance
Compute a image of the local variance
def local_var(img, size=3):
    """ Compute a image of the local variance
    """
    structure_element = np.ones((size, size), dtype=img.dtype)
    l_var = signal.correlate(img**2, structure_element, mode='same')
    l_var /= size**2
    l_var -= local_mean(img, size=size)**2
    return l_var
def local_var ( img , size = 3 ) : structure_element = np . ones ( ( size , size ) , dtype = img . dtype ) l_var = signal . correlate ( img ** 2 , structure_element , mode = 'same' ) l_var /= size ** 2 l_var -= local_mean ( img , size = size ) ** 2 return l_var