Let image patch fly.
The function of this library is to divide the image into patches, and then merge the patches into the original image. The division and splicing of images are mainly based on the position index of the image.
pip install patchfly
Args:
img_array ([numpy array]): [The original image array]
patch_size ([type]): [description]
Returns:
[Tuple]: [The target patch size.]
Args:
img_patches ([numpy array]): [The output of patchfly]
img_size ([Tuple]): [The recon image size]
patch_size ([Tuple]): []
Returns:
[np.array]: [recon image]
"""
>>> from patchfly import patchfly
>>> from patchfly import unpatchfly
>>> import numpy as np
>>> img = np.ones((3333, 3333, 3))
>>> img.shape
(3333, 3333, 3)
>>> patches = patchfly(img, (256, 256, 3))
>>> patches.shape
(14, 14, 1, 256, 256, 3)
>>> recon = unpatchfly(patches, img.shape)
>>> recon.shape
(3333, 3333, 3)