dovahcrow / patchify.py

A library that helps you split image into small, overlappable patches, and merge patches into original image.
MIT License
211 stars 25 forks source link

Does unpatchify perform averaging ? #9

Closed omagdy closed 3 years ago

omagdy commented 3 years ago

So I am doing some image processing on 3D images and rather than operate on the entire image I want to split it first into patches and perform the image processing on each patch.

Say I have an image with dimensions 240x240x160 and I patchify it with a patch shape 40x40x40 and 20 as step size then the patches will be overlapping.

My question is the following: When these overlapping patches are unpatchified, are the overlapping pixels averaged over all their values to get the final output ?

Thanks in advance.

dovahcrow commented 3 years ago

No, there's no averaging for overlapping edges of the patches. The overlapped edges will be cropped away.

yongshuo-Z commented 3 years ago

Any plan to add the function for averaging for overlapping edges of the patches? Thanks!

dovahcrow commented 3 years ago

@yongshuo-Z https://github.com/dovahcrow/patchify.py/issues/6 I was planning to let this library support recovering from overlapped edges but haven't got time to implement it.