更新时间:2022-06-10 00:08:21
我们可以利用 np.lib.stride_tricks.as_strided
基于
We can leverage np.lib.stride_tricks.as_strided
based scikit-image's view_as_windows
for efficient patch extraction, like so -
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 output
out = w[i]
相关: