importing a raster image into matlab

조회 수: 4 (최근 30일)
Hassan
Hassan 2011년 4월 15일
I have a 3 dimensional array in ENVI format (bsq format). I wonder how can I import it in Matlab.I used the following code but it's for writing a new array and not for reading an exisiting array into Matlab. I apperciate your help in advance.
rows=743; cols=210; bands=6;
filename = 'myfile';
fid = fopen(filename, 'w', 'ieee-le');
fwrite(fid, 1:rows*cols*bands, 'float');
fclose(fid);
im1 = multibandread(filename, [rows cols bands], ...
'float', 0, 'bsq', 'ieee-le' )
  댓글 수: 1
Hassan
Hassan 2011년 4월 17일
well, I deleted the lines 2,3 and 4 and it's working fine now.

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

답변 (2개)

Walter Roberson
Walter Roberson 2011년 4월 15일
I found a page with documentation that suggests that the multibandread() command should work, as long as you match datatypes and byte order properly.
  댓글 수: 1
Hassan
Hassan 2011년 4월 17일
Thanks for the comment. the page you refered to, is ENVI's help file. There's nothing about that function.

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


Chethan S
Chethan S 2011년 4월 17일
If you have Image Processing Toolbox you could easily use imread to read the image and imshow to display it.
  댓글 수: 1
Hassan
Hassan 2011년 4월 17일
thanks for the comment. the format of my image is bsq (ENVIformat). I tried imread function but it couldn't recognize the format.

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

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by