我们可以利用
np.lib.stride_tricks.as_strided基础
scikit-image's view_as_windows来有效地提取补丁,就像这样-
from skimage.util.shape import view_as_windows# Get sliding windows (these are simply views)w = view_as_windows(s, l)# Index with indices, i for desired outputout = w[i]



