用Matlab读写YUV文件(备忘)

 fid=fopen('E://Record20091109-164748.yuv','rb');
outfid=fopen('E://ReWrite.yuv','wb');

 

fseek(fid,352*288*1.5*10,'bof');

 

for i=1:10
Y=fread(fid,[352,288],'uint8');
U=fread(fid,[352/2,288/2],'uint8');
V=fread(fid,[352/2,288/2],'uint8');

 

fwrite(outfid,Y,'uint8');
fwrite(outfid,U,'uint8');
fwrite(outfid,V,'uint8');
end

 

fclose(fid);
fclose(outfid);

 

imshow(uint8(Y'))

你可能感兴趣的:(用Matlab读写YUV文件(备忘))