def regular_seeds(ar_shape, n_points, dtype=int):
 grid = regular_grid(ar_shape, n_points)
 seed_img = np.zeros(ar_shape, dtype=dtype)
 seed_img[grid] = (1 + np.reshape(np.arange(seed_img[grid].size), seed_img[grid].shape))
 return seed_img

def regular_seeds ( ar_shape , n_points , dtype = int ) : grid = regular_grid ( ar_shape , n_points ) seed_img = np . zeros ( ar_shape , dtype = dtype ) seed_img [ grid ] = ( 1 + np . reshape ( np . arange ( seed_img [ grid ] . size ) , seed_img [ grid ] . shape ) ) return seed_img
return an image with ~n_points regularly-spaced nonzero pixels .