Want to convert hyperspectral .mat file to multiple .jpeg files

2 ビュー (過去 30 日間)
Yogesh Awate
Yogesh Awate 2017 年 11 月 15 日
回答済み: Rik 2017 年 11 月 16 日
Please help me to create multiple images(.jpeg) based on each band. In PaviaU.mat which has 610x340x103, i want extract 103 images out of it. Thank you. PaviU.mat

採用された回答

Rik
Rik 2017 年 11 月 16 日
You can just use indexing.
for n=1:103
IM_slice=A(:,:,n);
imwrite(IM_slice,sprintf('%03d.jpeg',n));
end
Are you sure you want to do this? JPEG is lossy, which means you will be losing quality. If file size isn't a major concern, consider a lossless file format, like png. especially if you intend to do processing on the images instead of the original hypercube (which is what you should use for further processing).

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHyperspectral Image Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by