summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m25
1 files changed, 25 insertions, 0 deletions
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 @@
1% IM = mkImpulse(SIZE, ORIGIN, AMPLITUDE)
2%
3% Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar)
4% containing a single non-zero entry, at position ORIGIN (defaults to
5% ceil(size/2)), of value AMPLITUDE (defaults to 1).
6
7% Eero Simoncelli, 6/96.
8
9function [res] = mkImpulse(sz, origin, amplitude)
10
11sz = sz(:)';
12if (size(sz,2) == 1)
13 sz = [sz sz];
14end
15
16if (exist('origin') ~= 1)
17 origin = ceil(sz/2);
18end
19
20if (exist('amplitude') ~= 1)
21 amplitude = 1;
22end
23
24res = zeros(sz);
25res(origin(1),origin(2)) = amplitude;