def test_scharr_vertical():
 (i, j) = np.mgrid[(-5):6, (-5):6]
 image = (j >= 0).astype(float)
 result = (filters.scharr(image) * np.sqrt(2))
 j[(np.abs(i) == 5)] = 10000
 assert_allclose(result[(j == 0)], 1)
 assert np.all((result[(np.abs(j) > 1)] == 0))

def test_scharr_vertical ( ) : ( i , j ) = np . mgrid [ ( - 5 ) : 6 , ( - 5 ) : 6 ] image = ( j >= 0 ) . astype ( float ) result = ( filters . scharr ( image ) * np . sqrt ( 2 ) ) j [ ( np . abs ( i ) == 5 ) ] = 10000 assert_allclose ( result [ ( j == 0 ) ] , 1 ) assert np . all ( ( result [ ( np . abs ( j ) > 1 ) ] == 0 ) )
scharr on a vertical edge should be a vertical line .