I have a hyperspectral dataset of size (272, 512, 16) where 16 is the number of bands, the idea is I want to generate the RGB images form those hyperspectral but the problem is I have tried so many codes but nothing is working with me .
this is my code to read the hyperspectral data
d2 = io.loadmat('/content/drive/MyDrive/OtherCube/Melt2.mat')
d2= d2['DataCubeC']
D2 =d2.astype(np.float32)
pc= hsi.principal_components(D2)
plt.title('Principal components')
plt.imshow(pc)
plt.axis('off')
And after this step I need to regenerate the rgb image
I have tried so many codes but because the shape of my data is different so nothing was working with me