How to import three dimensional hyperspectral data (.mat) into Deep learning toolbox?

2 visualizaciones (últimos 30 días)
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.
  1. 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

Respuestas (1)

Parth Parikh
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:

Categorías

Más información sobre Hyperspectral Image Processing en Help Center y File Exchange.

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by