I have a 4 GB image file that Matlab is choking on. I'd like to get this file into Matlab. Here is the code that makes my computer freeze:
fid=fopen('myimage.img','r','l');
M=fread(fid,[48333,41779],'uint16');
fclose(fid);
Equivalent code works well for a similar, smaller image, but this image is large. Subsetting into quadrants or sixteenths would be fine by me, but I don't know how to subset for a .img file. I know subsetting a tiff works with imread. Any suggestions for getting this big image into Matlab?

1 件のコメント

Ashish Uthama
Ashish Uthama 2014 年 7 月 18 日
If you have a current version with Image processing toolbox, this blog post might be useful: "Dealing with “Really Big” Images: Block Processing"

サインインしてコメントする。

 採用された回答

José-Luis
José-Luis 2014 年 7 月 17 日
編集済み: José-Luis 2014 年 7 月 17 日

0 投票

Sounds like a job for memmapfile()
doc memmapfile
Alternatively, you could split your image beforehand.

2 件のコメント

Chad Greene
Chad Greene 2014 年 7 月 17 日
Thanks for pointing me to memmapfile, José-Luis. This might just be the ticket.
José-Luis
José-Luis 2014 年 7 月 17 日
Glad to help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by