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/readpfm3.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 SD-VBS/common/toolbox/toolbox_basic/io/readpfm3.m (limited to 'SD-VBS/common/toolbox/toolbox_basic/io/readpfm3.m') diff --git a/SD-VBS/common/toolbox/toolbox_basic/io/readpfm3.m b/SD-VBS/common/toolbox/toolbox_basic/io/readpfm3.m new file mode 100755 index 0000000..15ba959 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/io/readpfm3.m @@ -0,0 +1,17 @@ +function I = readpfm(filename) + +fid = fopen(filename,'r'); + +A = fscanf(fid,'%d',3); +A(3) = max(1,A(3)); + +I = fscanf(fid,'%f',[A(1)*A(2)*A(3)]); + +%I = fscanf(fid,'%f',A(2)*A(1));I = reshape(I,A(1),A(2)); + +I = reshape(I,A(2),A(1),A(3)); +I = permute(I,[2,1,3]); + +I = squeeze(I); + +fclose(fid); -- cgit v1.2.2