summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m
diff options
context:
space:
mode:
authorleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
committerleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
commit25d94aa8aabb8ac3e8bbea0bc439ea6148444cc8 (patch)
treeba80e76d25d9ca9486092e2f6b6d76f0e3352bf7 /SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m
parente2b50015cebdfba68699abd6e8575e38230f5a78 (diff)
debug libextra and remove matlab
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m35
1 files changed, 0 insertions, 35 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m
deleted file mode 100755
index ab82782..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlab/histoMatch.m
+++ /dev/null
@@ -1,35 +0,0 @@
1% RES = histoMatch(MTX, N, X)
2%
3% Modify elements of MTX so that normalized histogram matches that
4% specified by vectors X and N, where N contains the histogram counts
5% and X the histogram bin positions (see histo).
6
7% Eero Simoncelli, 7/96.
8
9function res = histoMatch(mtx, N, X)
10
11if ( exist('histo') == 3 )
12 [oN, oX] = histo(mtx(:), size(X(:),1));
13else
14 [oN, oX] = hist(mtx(:), size(X(:),1));
15end
16
17oStep = oX(2) - oX(1);
18oC = [0, cumsum(oN)]/sum(oN);
19oX = [oX(1)-oStep/2, oX+oStep/2];
20
21N = N(:)';
22X = X(:)';
23N = N + mean(N)/(1e8); %% HACK: no empty bins ensures nC strictly monotonic
24
25nStep = X(2) - X(1);
26nC = [0, cumsum(N)]/sum(N);
27nX = [X(1)-nStep/2, X+nStep/2];
28
29nnX = interp1(nC, nX, oC, 'linear');
30
31if ( exist('pointOp') == 3 )
32 res = pointOp(mtx, nnX, oX(1), oStep);
33else
34 res = reshape(interp1(oX, nnX, mtx(:)),size(mtx,1),size(mtx,2));
35end