Convert hyperspectral image between .mat and .tif format

조회 수: 4 (최근 30일)
Bi
Bi 2017년 12월 25일
댓글: Walter Roberson 2017년 12월 26일
If I have image that consists of hundreds of bands in .mat format, how can I convert it to .tif format with the same number of bands without data loss (, which can be analyzed with remote sensing software later on)? (e.g. PaviaU with 103 bands)
Vice versa, how can I convert the image in .tif format (,possibly product from remote sensing software,) to .mat format with the same number of bands without data loss for further process in MATLAB?
Thank you!

답변 (1개)

Walter Roberson
Walter Roberson 2017년 12월 25일
Generally speaking you would use the TIFF Class https://www.mathworks.com/help/matlab/ref/tiff-class.html for this work. But TIFF can represent multiple bands in different ways so you need to know which of the ways is expected by the other software.
You could also consider using imwrite() with 'WriteMode', 'append'
  댓글 수: 2
Bi
Bi 2017년 12월 26일
Would it be possible to illustrate them with code example? I may not be familiar with the classes suggested.
Walter Roberson
Walter Roberson 2017년 12월 26일
https://www.mathworks.com/help/matlab/import_export/importing-images.html#br_c8to-1 for code that deals with reading TIFF files that have subimages.
If you do not have subimages, then supposing you have an array Image103 that is something by something by 103, then
nband = size(Image103, 3);
for K = 1 : nband
if K == 1
imwrite(Image103(:,:,K), 'Image103.tif');
else
imwrite(Image103(:,:,K), 'Image103.tif', 'WriteMode', 'append');
end
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by