diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m deleted file mode 100755 index dd37164..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkRamp.m +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | % IM = mkRamp(SIZE, DIRECTION, SLOPE, INTERCEPT, ORIGIN) | ||
| 2 | % | ||
| 3 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) | ||
| 4 | % containing samples of a ramp function, with given gradient DIRECTION | ||
| 5 | % (radians, CW from X-axis, default = 0), SLOPE (per pixel, default = | ||
| 6 | % 1), and a value of INTERCEPT (default = 0) at the ORIGIN (default = | ||
| 7 | % (size+1)/2, [1 1] = upper left). All but the first argument are | ||
| 8 | % optional. | ||
| 9 | |||
| 10 | % Eero Simoncelli, 6/96. 2/97: adjusted coordinate system. | ||
| 11 | |||
| 12 | function [res] = mkRamp(sz, dir, slope, intercept, origin) | ||
| 13 | |||
| 14 | sz = sz(:); | ||
| 15 | if (size(sz,1) == 1) | ||
| 16 | sz = [sz,sz]; | ||
| 17 | end | ||
| 18 | |||
| 19 | % ----------------------------------------------------------------- | ||
| 20 | % OPTIONAL args: | ||
| 21 | |||
| 22 | if (exist('dir') ~= 1) | ||
| 23 | dir = 0; | ||
| 24 | end | ||
| 25 | |||
| 26 | if (exist('slope') ~= 1) | ||
| 27 | slope = 1; | ||
| 28 | end | ||
| 29 | |||
| 30 | if (exist('intercept') ~= 1) | ||
| 31 | intercept = 0; | ||
| 32 | end | ||
| 33 | |||
| 34 | if (exist('origin') ~= 1) | ||
| 35 | origin = (sz+1)/2; | ||
| 36 | end | ||
| 37 | |||
| 38 | % ----------------------------------------------------------------- | ||
| 39 | |||
| 40 | xinc = slope*cos(dir); | ||
| 41 | yinc = slope*sin(dir); | ||
| 42 | |||
| 43 | [xramp,yramp] = meshgrid( xinc*([1:sz(2)]-origin(2)), ... | ||
| 44 | yinc*([1:sz(1)]-origin(1)) ); | ||
| 45 | |||
| 46 | res = intercept + xramp + yramp; | ||
| 47 | |||
