1
function xyinput = dic_basecorr3(CORRSIZE, PRECISION, OPTIMIZE, hwid, base_points_x, base_points_y, base)
3
base_points_for(:,1)=reshape(base_points_x,[],1);
4
base_points_for(:,2)=reshape(base_points_y,[],1);
6
ncp = size(base_points_for, 1);
7
rects_base = dic_calc_rects(base_points_for,2*CORRSIZE,base);
13
if isequal(rects_base(icp,3:4),[0 0])
17
sub_base = imcrop(base,rects_base(icp,:));
19
if sum(sub_base(:)) == sub_base(1)*numel(sub_base)
20
eid = sprintf('Images:%s:sameElementsInTemplate',mfilename);
21
msg = 'The values of TEMPLATE cannot all be the same.';
26
double_sub_base = double(sub_base);
27
local_sum_A = dic_local_sum(double_sub_base,n,n);
28
local_sum_A2 = dic_local_sum(double_sub_base.*double_sub_base,n,n);
29
denom_A = sqrt( max(( local_sum_A2 - (local_sum_A.^2)/mn ) / (mn-1), 0) );
30
i_nonzero = find(denom_A~=0);
31
normxcorr_hw(hwid, 2, icp, sub_base, single(local_sum_A), single(denom_A), uint16(i_nonzero));