I uploaded my code, which decomposes an image to patches, on my git. The repository contains 2 basic functions and 1 demo code:
- im2patch.m: decomposes an image into a set of image patches
- patch2im.m: forms an image by merging a set of image patches
- demo_patching.m: shows how the above functions work