How do I create RAW image files in MATLAB?

조회 수: 33 (최근 30일)
MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
편집: MathWorks Support Team 2017년 4월 17일
I would like to use MATLAB in order to create binary RAW-files to store images.
The images I try to create using FWRITE do not open properly in Adobe Photoshop.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2017년 4월 17일
In order to create RAW-files for images in MATLAB, use the FWRITE function with 'uint8' or 'uint16' as the precision specifier, as in the example below (which creates a black image (all zeros) of size 100x100
 
cmodel=(zeros(300,100,1));
fid=fopen('blackimage.raw','w+');
cnt=fwrite(fid,cmodel,'uint8');
fclose(fid);

추가 답변 (0개)

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2006a

Community Treasure Hunt

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

Start Hunting!

Translated by