Converting 2d array to image using colormap

379 Views Asked by At

I decoded a signal using wavelet CWT to a 2D array with float values somewhat between -450.0 and 550.0, and I can show it with matplotlib's imshow function:

data=pywt.cwt(signal, scales, wavelet = wavelet)
plt.imshow(data, cmap = 'coolwarm', aspect = 'auto')
plt.show()

Which works just fine:

enter image description here

Now I want to convert this image to an array so I could feed it to a CNN model, yet I could not find any solutions. Can anyone point e in the right direction?

0

There are 0 best solutions below