importing a raster image into matlab
4 次查看(过去 30 天)
显示 更早的评论
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' )
回答(2 个)
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.
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!