def test_vertical_mask_line():
 (_, hgrad) = np.mgrid[:1:11j, :1:11j]
 hgrad[:, 5] = 1
 mask = np.ones_like(hgrad)
 mask[:, 5] = 0
 expected = np.zeros_like(hgrad)
 expected[1:(-1), 1:(-1)] = 0.2
 expected[1:(-1), 4:7] = 0
 for grad_func in (filters.prewitt_v, filters.sobel_v, filters.scharr_v):
  result = grad_func(hgrad, mask)
  (yield (assert_close, result, expected))

def test_vertical_mask_line ( ) : ( _ , hgrad ) = np . mgrid [ : 1 : 11j , : 1 : 11j ] hgrad [ : , 5 ] = 1 mask = np . ones_like ( hgrad ) mask [ : , 5 ] = 0 expected = np . zeros_like ( hgrad ) expected [ 1 : ( - 1 ) , 1 : ( - 1 ) ] = 0.2 expected [ 1 : ( - 1 ) , 4 : 7 ] = 0 for grad_func in ( filters . prewitt_v , filters . sobel_v , filters . scharr_v ) : result = grad_func ( hgrad , mask ) ( yield ( assert_close , result , expected ) )
vertical edge filters mask pixels surrounding input mask .