How to import three dimensional hyperspectral data (.mat) into Deep learning toolbox?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I am using Deep Network Designer (DND). I have three folder, filled with .mat files. These .mat files are cropped hyperspectral images of dimension (X,Y, 214). Here X and Y are image dimension which vary with every image and 214 is the number of channels or bands and is constant in all the images.
I was having no problem in importing these data using the function imagedatastore. But, I am facing these two problems.
- While importing the images is successful. I cannot view them on the DND dialog window.
2. When I try to train the model. I get an error that the input images need to be 3D.
If I open these individual matfiles using hyperspectralViewer. There is no problem.
Attached is the code that I have used to create the datastore and the network image.
Trainimds = imageDatastore("location of directory","FileExtensions",".mat","LabelSource","foldernames","IncludeSubfolders",true);
the network image
Here is a paper that does the same thing: https://www.researchgate.net/publication/347958844_Deep_learning_classifiers_for_near_infrared_spectral_imaging_A_tutorial
2 comentarios
Respuestas (1)
Parth Parikh
el 23 de Mzo. de 2023
Editada: Parth Parikh
el 23 de Mzo. de 2023
Hi Billy,
For the first issue, you can try using fileDatastore. As mentioned that you have 3 folders, contain all .mat files.
fds = fileDatastore(<path>, "ReadFcn", @load, "FileExtensions", ".mat");
For the second error,
It looks like you are passing 4D input to "image3dInputLayer".
image3dInputLayer([X Y 214 1], 'Name', 'Input');
If you wish to learn more about hyperspectral imaging, please have a look at the below links:
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!