def test_horizontal_mask_line():
 (vgrad, _) = np.mgrid[:1:11j, :1:11j]
 vgrad[5, :] = 1
 mask = np.ones_like(vgrad)
 mask[5, :] = 0
 expected = np.zeros_like(vgrad)
 expected[1:(-1), 1:(-1)] = 0.2
 expected[4:7, 1:(-1)] = 0
 for grad_func in (filters.prewitt_h, filters.sobel_h, filters.scharr_h):
  result = grad_func(vgrad, mask)
  (yield (assert_close, result, expected))

def test_horizontal_mask_line ( ) : ( vgrad , _ ) = np . mgrid [ : 1 : 11j , : 1 : 11j ] vgrad [ 5 , : ] = 1 mask = np . ones_like ( vgrad ) mask [ 5 , : ] = 0 expected = np . zeros_like ( vgrad ) expected [ 1 : ( - 1 ) , 1 : ( - 1 ) ] = 0.2 expected [ 4 : 7 , 1 : ( - 1 ) ] = 0 for grad_func in ( filters . prewitt_h , filters . sobel_h , filters . scharr_h ) : result = grad_func ( vgrad , mask ) ( yield ( assert_close , result , expected ) )
horizontal edge filters mask pixels surrounding input mask .