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

5 ビュー (過去 30 日間)
Billy Ram
Billy Ram 2023 年 3 月 23 日
コメント済み: Billy Ram 2023 年 4 月 5 日
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 Center および File ExchangeHyperspectral Image Processing についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by