Convert an Image to a binary (.bin) file
古いコメントを表示
Hello
I am trying to convert an image to a binary file (not binary image) for further processing in another software. I have tried the following code but does not seems to work as the file I am creating is zero bytes !
I= imread('cameraman.bin','w')
fid=fopen ('cameraman.bin','w');
fwrite(fid,I,'float32');
Can someone advice me on how to do this correctly ?
Thank you
採用された回答
その他の回答 (1 件)
David Sanchez
2013 年 9 月 16 日
Try this out:
I= imread('cameraman.tif');
level = .5;
BW = im2bw(I, level);
%choose your own options when writing to txt file
dlmwrite('myfile.txt', BW)
dlmwrite('myfile.txt', BW, 'delimiter', '\t', 'precision', 6)
2 件のコメント
Dimitris M
2013 年 9 月 16 日
Image Analyst
2013 年 9 月 16 日
He said he didn't want a binary image anyway.
カテゴリ
ヘルプ センター および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!