def frangi(image, scale_range=(1, 10), scale_step=2, beta1=0.5, beta2=15, black_ridges=True):
 (filtered, lambdas) = _frangi_hessian_common_filter(image, scale_range, scale_step, beta1, beta2)
 if black_ridges:
  filtered[(lambdas < 0)] = 0
 else:
  filtered[(lambdas > 0)] = 0
 return np.max(filtered, axis=0)

def frangi ( image , scale_range = ( 1 , 10 ) , scale_step = 2 , beta1 = 0.5 , beta2 = 15 , black_ridges = True ) : ( filtered , lambdas ) = _frangi_hessian_common_filter ( image , scale_range , scale_step , beta1 , beta2 ) if black_ridges : filtered [ ( lambdas < 0 ) ] = 0 else : filtered [ ( lambdas > 0 ) ] = 0 return np . max ( filtered , axis = 0 )
filter an image with the frangi filter .