I have this func that splits my initial img into arrays of 100x100
def blockshaped(arr, nrows, ncols):
h, w = arr.shape
return (arr.reshape(h//nrows, nrows, -1, ncols)
.swapaxes(1,2)
.reshape(-1, nrows, ncols))
Then this loop makes a new_img filled with arrays of zeros if enumerate == even, and block if is not
image = np.full((1000,2000),5)
blocks = blockshaped(image,100,100)
new_image = []
for i,block in enumerate(blocks):
if i%2==0:
new_image.append(np.zeros((100,100)))
else:
new_image.append(block)
Now I dont know how can I build a final image 1000x2000 filled with my new_image arrays.
Any idea???


