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/writepgm.m | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 SD-VBS/common/toolbox/toolbox_basic/io/writepgm.m (limited to 'SD-VBS/common/toolbox/toolbox_basic/io/writepgm.m') diff --git a/SD-VBS/common/toolbox/toolbox_basic/io/writepgm.m b/SD-VBS/common/toolbox/toolbox_basic/io/writepgm.m new file mode 100755 index 0000000..113cb18 --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/io/writepgm.m @@ -0,0 +1,8 @@ +function I = writepgm(name,I) + + [y,x] = size(I); + + fid = fopen(name, 'w'); + fprintf(fid, 'P5\n%d %d\n255\n', x,y); + fwrite(fid, I', 'uint8'); + fclose(fid); -- cgit v1.2.2