diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
| commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
| tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m | |
| parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (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-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/mkImpulse.m | 25 |
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 | |||
| 9 | function [res] = mkImpulse(sz, origin, amplitude) | ||
| 10 | |||
| 11 | sz = sz(:)'; | ||
| 12 | if (size(sz,2) == 1) | ||
| 13 | sz = [sz sz]; | ||
| 14 | end | ||
| 15 | |||
| 16 | if (exist('origin') ~= 1) | ||
| 17 | origin = ceil(sz/2); | ||
| 18 | end | ||
| 19 | |||
| 20 | if (exist('amplitude') ~= 1) | ||
| 21 | amplitude = 1; | ||
| 22 | end | ||
| 23 | |||
| 24 | res = zeros(sz); | ||
| 25 | res(origin(1),origin(2)) = amplitude; | ||
