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 --- .../tracking/src/matlab/getInterpolatePatch.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 SD-VBS/benchmarks/tracking/src/matlab/getInterpolatePatch.m (limited to 'SD-VBS/benchmarks/tracking/src/matlab/getInterpolatePatch.m') diff --git a/SD-VBS/benchmarks/tracking/src/matlab/getInterpolatePatch.m b/SD-VBS/benchmarks/tracking/src/matlab/getInterpolatePatch.m new file mode 100755 index 0000000..d0a64d3 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/matlab/getInterpolatePatch.m @@ -0,0 +1,22 @@ +function [dstImg] = getInterpolatePatch(srcImg,rows, cols,centerX,centerY,winSize) + +a=centerX-floor(centerX); +b=centerY-floor(centerY); +a11=(1-a)*(1-b); +a12=a*(1-b); +a21=(1-a)*b; +a22=a*b; + +for i=-winSize:winSize-1 + srcIdxx=floor(centerY)+i; + dstIdxx=i+winSize+1; + for j=-winSize:winSize-1 + srcIdx = srcIdxx * cols + floor(centerX) + j; + dstIdx = dstIdxx*2*winSize+j+winSize+1; + dstImg(dstIdx)=srcImg(srcIdxx, floor(centerX)+j)*a11; + dstImg(dstIdx)= dstImg(dstIdx) + srcImg(srcIdxx, floor(centerX)+j+1)*a12; + dstImg(dstIdx)= dstImg(dstIdx) + srcImg(srcIdxx+1, floor(centerX)+j)*a21; + dstImg(dstIdx)= dstImg(dstIdx) + srcImg(srcIdxx+1, floor(centerX)+j+1)*a22; + end +end + -- cgit v1.2.2