Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reading ENVI Image Into MATLAB

295 views
Skip to first unread message

chia ming chen

unread,
Oct 10, 2003, 5:07:51 PM10/10/03
to
I am trying to read an ENVI image (.RAW) into MATLAB using the
commands below. The new image does not resemble the original image.
The size of my image is [10322,1600]. Data type is float. Has anyone
done this before? Thanks!


fid=fopen('a1_bk_sapph.raw','r');
img=fread(fid,[10322,1600],'float32');
frewind(fid);
fclose(fid);

J Luis

unread,
Oct 10, 2003, 5:20:41 PM10/10/03
to
chia ming chen wrote:
>
>
> I am trying to read an ENVI image (.RAW) into MATLAB using the
> commands below. The new image does not resemble the original
> image.
> The size of my image is [10322,1600]. Data type is float. Has
> anyone
> done this before? Thanks!
>
Chia,
You may want to try my m_gmt program (w3.ualg.pt/~jluis/m_gmt). It
has no manual yet but it is able to read ENVI files via a mex file
based on gdal. (use the ecran_grd program)

eitan

unread,
Oct 11, 2003, 2:50:53 AM10/11/03
to
hi,
the raw envi image comes with no header.
first, u have to find out (in the envi header file) what is the image
format (BIP, BIL, BSQ), and than read the data accordingly.
if u have more questions, do ask.
hope this helps,
eitan
0 new messages