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/matlabPyrTools/mkAngularSine.m | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkAngularSine.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkAngularSine.m | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkAngularSine.m b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkAngularSine.m new file mode 100755 index 0000000..f5238cc --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/mkAngularSine.m | |||
@@ -0,0 +1,42 @@ | |||
1 | % IM = mkAngularSine(SIZE, HARMONIC, AMPL, PHASE, ORIGIN) | ||
2 | % | ||
3 | % Make an angular sinusoidal image: | ||
4 | % AMPL * sin( HARMONIC*theta + PHASE), | ||
5 | % where theta is the angle about the origin. | ||
6 | % SIZE specifies the matrix size, as for zeros(). | ||
7 | % AMPL (default = 1) and PHASE (default = 0) are optional. | ||
8 | |||
9 | % Eero Simoncelli, 2/97. | ||
10 | |||
11 | function [res] = mkAngularSine(sz, harmonic, ampl, ph, origin) | ||
12 | |||
13 | sz = sz(:); | ||
14 | if (size(sz,1) == 1) | ||
15 | sz = [sz,sz]; | ||
16 | end | ||
17 | |||
18 | mxsz = max(sz(1),sz(2)); | ||
19 | |||
20 | %------------------------------------------------------------ | ||
21 | %% OPTIONAL ARGS: | ||
22 | |||
23 | if (exist('harmonic') ~= 1) | ||
24 | harmonic = 1; | ||
25 | end | ||
26 | |||
27 | if (exist('ampl') ~= 1) | ||
28 | ampl = 1; | ||
29 | end | ||
30 | |||
31 | if (exist('ph') ~= 1) | ||
32 | ph = 0; | ||
33 | end | ||
34 | |||
35 | if (exist('origin') ~= 1) | ||
36 | origin = (sz+1)/2; | ||
37 | end | ||
38 | |||
39 | %------------------------------------------------------------ | ||
40 | |||
41 | res = ampl * sin(harmonic*mkAngle(sz,ph,origin) + ph); | ||
42 | |||