⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pgm2x.m~

📁 this a SVM toolbox,it is very useful for someone who just learn SVM.In order to be undestood easily,
💻 M~
字号:
function [X,width,height]=pgm2x(fname)% [X,width,height]=pgm2x(fname)%% PGM2X reads an image from fname which must be in the PGM %  format. The read image is returned as a column vector %  (double) normalized to <0,1>.%  % Input:%  fname [string] file nam of the image.%% Output:%  X [width x height] vector containg read image.%  width [1x1] width of the image.%  height [1x1] height of the image.%% See also X2PGM%% 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,'r');line1=fgets(fid);line2=fgets(fid);line3=fgets(fid);a = sscanf(line2,'%d');width=a(1);height=a(2);prec= sscanf(line3, '%d');if  prec==255,  precision='uchar';elseif prec==65535,  precision='int16';end[X, count] = fread(fid,inf,precision);fclose(fid);if count ~= width*height,  error('Invalid input format.');  return;endX=X(:);X=double(X)/prec;return;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -