importing image

조회 수: 3 (최근 30일)
Hassan
Hassan 2011년 4월 19일
I have a big 3-dimensional array (1500 rows, 500 columns, 4 bands) in band-sequential (BSQ)format. I tried Multibandread() function but it takes ages to read the data. Is there any faster way to import the data into Matlab? I appereciate your help.

채택된 답변

Jan
Jan 2011년 4월 20일
Did you try a simple FREAD?
FID = fopen(FileName, 'r');
if FID < 0; error('Cannot open file'); end
% Skip the header here...
Data = fread(FID, Inf, 'uint8=>uint8'); % Choose the correct format!
fclose(FID);
Data = reshape(Data, [500, 1500, 4]);
Data = permute(Data, [2, 1, 3]);
  댓글 수: 1
Hassan
Hassan 2011년 4월 21일
thanks a lot Jan.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by