📄 x2pgm.m
字号:
function x2pgm(X,width,height,fname)% x2pgm(X,fname)%% X2PGM write an image from the vector X to the file fname% in the PGM format. The vector is supposed to be double% and normalized to <0,1>. The arguments width and height% determine the shape of the image.%% Input:% X [size x 1] contains input image of given size.% width [1x1] width of the image.% height [1x1] height of the image.% fname [string] name of the file where the image is to be written.%%% See also PGM2X%% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz% Written Vojtech Franc (diploma thesis)% Modifications% 26-feb-2001 V.Francfid=fopen(fname, 'w' );fprintf(fid, 'P5\n');fprintf(fid, '%d %d\n',width, height );fprintf(fid, '255\n' );X=uint8(X*255);fwrite(fid,X,'uchar');fclose(fid);return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -