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

5 次查看(过去 30 天)
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

回答(1 个)

Parth Parikh
Parth Parikh 2023-3-23
编辑:Parth Parikh 2023-3-23
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:

类别

Help CenterFile Exchange 中查找有关 Hyperspectral Image Processing 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by