I'm creating a colour-over-grayscale image to show classification of image blocks. I need to upsample a low-resolution classification image to match the original image size, using zero-order.
When I use skimage.transform.rescale(I,16,order=0)
, I get the desired result:
However, when I use
scipy.ndimage.zoom(I,16,order=0)
, I get the following image with misalignment of the upsampled classification blocks and the original image patches (note the non-square blocks at the edges):
My questions are:
- Is this expected behaviour?
- Why the difference?
I could see the zoom
behaviour causing unexpected grief, since I only noticed it here with the obvious misalignment of blocks.
[edit 1]: perhaps related question.
[edit 2]: Should be able to pull this repo and run python main.py with one of two imports at the top commented (flagged).