1
%-------------------------------
4
function local_sum_A = dic_local_sum(A,m,n)
6
% We thank Eli Horn for providing this code, used with his permission,
7
% to speed up the calculation of local sums. The algorithm depends on
8
% precomputing running sums as described in "Fast Normalized
9
% Cross-Correlation", by J. P. Lewis, Industrial Light & Magic.
10
% http://www.idiom.com/~zilla/Papers/nvisionInterface/nip.html
14
B = [zeros(m,nA+2*n-1);
15
zeros(mA,n) A zeros(mA,n-1);
18
c = s(1+m:end,:)-s(1:end-m,:);
20
local_sum_A = s(:,1+n:end)-s(:,1:end-n);