diff options
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/mkDisc.m')
| -rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/matlab/mkDisc.m | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkDisc.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkDisc.m deleted file mode 100755 index 33e7d6d..0000000 --- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/mkDisc.m +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | % IM = mkDisc(SIZE, RADIUS, ORIGIN, TWIDTH, VALS) | ||
| 2 | % | ||
| 3 | % Make a "disk" image. SIZE specifies the matrix size, as for | ||
| 4 | % zeros(). RADIUS (default = min(size)/4) specifies the radius of | ||
| 5 | % the disk. ORIGIN (default = (size+1)/2) specifies the | ||
| 6 | % location of the disk center. TWIDTH (in pixels, default = 2) | ||
| 7 | % specifies the width over which a soft threshold transition is made. | ||
| 8 | % VALS (default = [0,1]) should be a 2-vector containing the | ||
| 9 | % intensity value inside and outside the disk. | ||
| 10 | |||
| 11 | % Eero Simoncelli, 6/96. | ||
| 12 | |||
| 13 | function [res] = mkDisc(sz, rad, origin, twidth, vals) | ||
| 14 | |||
| 15 | if (nargin < 1) | ||
| 16 | error('Must pass at least a size argument'); | ||
| 17 | end | ||
| 18 | |||
| 19 | sz = sz(:); | ||
| 20 | if (size(sz,1) == 1) | ||
| 21 | sz = [sz sz]; | ||
| 22 | end | ||
| 23 | |||
| 24 | %------------------------------------------------------------ | ||
| 25 | % OPTIONAL ARGS: | ||
| 26 | |||
| 27 | if (exist('rad') ~= 1) | ||
| 28 | rad = min(sz(1),sz(2))/4; | ||
| 29 | end | ||
| 30 | |||
| 31 | if (exist('origin') ~= 1) | ||
| 32 | origin = (sz+1)./2; | ||
| 33 | end | ||
| 34 | |||
| 35 | if (exist('twidth') ~= 1) | ||
| 36 | twidth = 2; | ||
| 37 | end | ||
| 38 | |||
| 39 | if (exist('vals') ~= 1) | ||
| 40 | vals = [1,0]; | ||
| 41 | end | ||
| 42 | |||
| 43 | %------------------------------------------------------------ | ||
| 44 | |||
| 45 | res = mkR(sz,1,origin); | ||
| 46 | |||
| 47 | if (abs(twidth) < realmin) | ||
| 48 | res = vals(2) + (vals(1) - vals(2)) * (res <= rad); | ||
| 49 | else | ||
| 50 | [Xtbl,Ytbl] = rcosFn(twidth, rad, [vals(1), vals(2)]); | ||
| 51 | res = pointOp(res, Ytbl, Xtbl(1), Xtbl(2)-Xtbl(1), 0); | ||
| 52 | % | ||
| 53 | % OLD interp1 VERSION: | ||
| 54 | % res = res(:); | ||
| 55 | % Xtbl(1) = min(res); | ||
| 56 | % Xtbl(size(Xtbl,2)) = max(res); | ||
| 57 | % res = reshape(interp1(Xtbl,Ytbl,res), sz(1), sz(2)); | ||
| 58 | % | ||
| 59 | end | ||
| 60 | |||
| 61 | |||
