I have an image that is currently in a numpy array. This is useful for my work as I with to do things with the images fourier transform.
Currently I am interested in viewing the fourier transform of lots of bits of the image. The image is a 512x512 array in numpy and I would like to split it into small boxes. I am thinking of splitting it into 4 boxes then 16 boxes.
I have found np.array_split however this appears to only split the array into strips. As a result I am just calling it multiple times as shown below (where Real is the input array of 512,512)
H1, H2 = np.array_split(Real, 2, axis=0)
B1, B2 = np.array_split(H1, 2, axis=1)
B3, B4 = np.array_split(H2, 2, axis=1)
fig, ax = plt.subplots(2, 2)
ax[0,0].imshow(B1, cmap='Greys')
ax[0,1].imshow(B2, cmap='Greys')
ax[1,0].imshow(B3, cmap='Greys')
ax[1,1].imshow(B4, cmap='Greys')
plt.show()
When I split them into 16 this feels like it is going to look very untidy. I was wondering if I am not noticing another numpy function i could use?
thank you