diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkSine.m')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/mkSine.m | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkSine.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkSine.m deleted file mode 100755 index 147eb01..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkSine.m +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | % IM = mkSine(SIZE, PERIOD, DIRECTION, AMPLITUDE, PHASE, ORIGIN) | ||
2 | % or | ||
3 | % IM = mkSine(SIZE, FREQ, AMPLITUDE, PHASE, ORIGIN) | ||
4 | % | ||
5 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) | ||
6 | % containing samples of a 2D sinusoid, with given PERIOD (in pixels), | ||
7 | % DIRECTION (radians, CW from X-axis, default = 0), AMPLITUDE (default | ||
8 | % = 1), and PHASE (radians, relative to ORIGIN, default = 0). ORIGIN | ||
9 | % defaults to the center of the image. | ||
10 | % | ||
11 | % In the second form, FREQ is a 2-vector of frequencies (radians/pixel). | ||
12 | |||
13 | % Eero Simoncelli, 6/96. | ||
14 | |||
15 | function [res] = mkSine(sz, per_freq, dir_amp, amp_phase, phase_orig, orig) | ||
16 | |||
17 | %------------------------------------------------------------ | ||
18 | %% OPTIONAL ARGS: | ||
19 | |||
20 | if (prod(size(per_freq)) == 2) | ||
21 | frequency = norm(per_freq); | ||
22 | direction = atan2(per_freq(1),per_freq(2)); | ||
23 | if (exist('dir_amp') == 1) | ||
24 | amplitude = dir_amp; | ||
25 | else | ||
26 | amplitude = 1; | ||
27 | end | ||
28 | if (exist('amp_phase') == 1) | ||
29 | phase = amp_phase; | ||
30 | else | ||
31 | phase = 0; | ||
32 | end | ||
33 | if (exist('phase_orig') == 1) | ||
34 | origin = phase_orig; | ||
35 | end | ||
36 | if (exist('orig') == 1) | ||
37 | error('Too many arguments for (second form) of mkSine'); | ||
38 | end | ||
39 | else | ||
40 | frequency = 2*pi/per_freq; | ||
41 | if (exist('dir_amp') == 1) | ||
42 | direction = dir_amp; | ||
43 | else | ||
44 | direction = 0; | ||
45 | end | ||
46 | if (exist('amp_phase') == 1) | ||
47 | amplitude = amp_phase; | ||
48 | else | ||
49 | amplitude = 1; | ||
50 | end | ||
51 | if (exist('phase_orig') == 1) | ||
52 | phase = phase_orig; | ||
53 | else | ||
54 | phase = 0; | ||
55 | end | ||
56 | if (exist('orig') == 1) | ||
57 | origin = orig; | ||
58 | end | ||
59 | end | ||
60 | |||
61 | %------------------------------------------------------------ | ||
62 | |||
63 | if (exist('origin') == 1) | ||
64 | res = amplitude*sin(mkRamp(sz, direction, frequency, phase, origin)); | ||
65 | else | ||
66 | res = amplitude*sin(mkRamp(sz, direction, frequency, phase)); | ||
67 | end | ||