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 --- .../texture_synthesis/src/matlab/mkImpulse.m | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m new file mode 100755 index 0000000..9844ee8 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m @@ -0,0 +1,25 @@ +% IM = mkImpulse(SIZE, ORIGIN, AMPLITUDE) +% +% Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) +% containing a single non-zero entry, at position ORIGIN (defaults to +% ceil(size/2)), of value AMPLITUDE (defaults to 1). + +% Eero Simoncelli, 6/96. + +function [res] = mkImpulse(sz, origin, amplitude) + +sz = sz(:)'; +if (size(sz,2) == 1) + sz = [sz sz]; +end + +if (exist('origin') ~= 1) + origin = ceil(sz/2); +end + +if (exist('amplitude') ~= 1) + amplitude = 1; +end + +res = zeros(sz); +res(origin(1),origin(2)) = amplitude; -- cgit v1.2.2