From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m (limited to 'SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m') diff --git a/SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m b/SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m new file mode 100755 index 0000000..88fe907 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/io/readpmm.m @@ -0,0 +1,22 @@ +function I=readpmm(name) +% +% I=writepmm(name) +% +% I is a mul-band image +% + fid = fopen(name,'r'); + + if (fid <0), + error(sprintf('can not find file %s',name)); + end + + a = fscanf(fid,'%d',3); + nr = a(1);nc = a(2);nb = a(3); + + + I = fscanf(fid, '%f\n', nr*nc*nb); + + I = reshape(I,nc,nr,nb)'; + I = squeeze(I); + + fclose(fid); -- cgit v1.2.2