help inverting scikimage.utils.view_as_blocks
-
can anyone help me to invert scikimage.utils.view_as_blocks?
utils.view_as_blocks can make a (128,128) array become (16,16,8,8) so i can work on 8x8 blocks.
But how can I (simply) rebuild the 128x128 original image?
Thank you.
@cpv?
-
last edited by
-
@jmv38 If I am @cpv, I don't know why you think I could help you 😀
I hope @ccc answer will help you
-
@ccc thanks a lot. Strange that i could not find this in ggogle... Notusing the right english words.
-
@cvp sorry for the misspelling. 😜😔
-
@ccc that did it.
For anyone interested, in short:
img is a 4x4 image,
img1 = view_as_blocks(img, block_shape=(2,2))
can be inverted by:
img1.transpose(0,2,1,3).reshape(4,4)