From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- .../texture_synthesis/src/matlab/pointOp.m | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/matlab/pointOp.m (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlab/pointOp.m') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlab/pointOp.m b/SD-VBS/benchmarks/texture_synthesis/src/matlab/pointOp.m new file mode 100755 index 0000000..feb7750 --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/matlab/pointOp.m @@ -0,0 +1,28 @@ +% RES = pointOp(IM, LUT, ORIGIN, INCREMENT, WARNINGS) +% +% Apply a point operation, specified by lookup table LUT, to image IM. +% LUT must be a row or column vector, and is assumed to contain +% (equi-spaced) samples of the function. ORIGIN specifies the +% abscissa associated with the first sample, and INCREMENT specifies the +% spacing between samples. Between-sample values are estimated via +% linear interpolation. If WARNINGS is non-zero, the function prints +% a warning whenever the lookup table is extrapolated. +% +% This function is much faster than MatLab's interp1, and allows +% extrapolation beyond the lookup table domain. The drawbacks are +% that the lookup table must be equi-spaced, and the interpolation is +% linear. + +% Eero Simoncelli, 8/96. + +function res = pointOp(im, lut, origin, increment, warnings) + +%% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) + +%fprintf(1,'WARNING: You should compile the MEX version of "pointOp.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster.\n'); + +X = origin + increment*[0:size(lut(:),1)-1]; +Y = lut(:); + +res = reshape(interp1(X, Y, im(:), 'linear', 'extrap'),size(im)); + -- cgit v1.2.2