How to efficiently subsample from large images

You could probably use unfold directly to create these patches.
Have a look at this post for a simple example.