matlab读取二进制数据到图像矩阵

clear all

fid=fopen('./dumpdata/100_mask_224x224.gray','rb');
num = 224*224;
[row_array, ele_count]=fread(fid,num,'uint8');
fclose(fid);
a=reshape(row_array,224,224);
a = uint8(a);
figure;
imshow(a);

 

posted on 2022-05-12 10:00  Maddock  阅读(14)  评论(0编辑  收藏  举报

导航