/normxcorr/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dic_cpcorr.m

  • Committer: Suren A. Chilingaryan
  • Date: 2009-01-16 23:37:17 UTC
  • Revision ID: csa@dside.dyndns.org-20090116233717-ycbj2qqk5bdyed6a
Support for different optimization modes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function xyinput = dic_cpcorr(CORRSIZE, PRECISION, hwid, base, xyinput_in, input)
 
1
function xyinput = dic_cpcorr(CORRSIZE, PRECISION, OPTIMIZE, hwid, base, xyinput_in, input)
2
2
%   Copyright 1993-2004 The MathWorks, Inc.
3
3
%   $Revision: 1.16.4.4 $  $Date: 2004/10/20 17:54:13 $
4
4
 
5
 
%input = double(input);
6
 
 
7
5
if any(xyinput_in(:)<0.5) || any(xyinput_in(:,1)>size(input,2)+0.5) || ...
8
6
   any(xyinput_in(:,2)>size(input,1)+0.5)
9
7
    msg = sprintf('In function %s, Control Points must be in pixel coordinates.',mfilename);
50
48
        continue
51
49
    end
52
50
 
53
 
    norm_cross_corr = double(normxcorr_hw(hwid, 11, icp, rot90(sub_input,2), sum_T, denom_T));
 
51
    if (OPTIMIZE > 2)
 
52
        norm_cross_corr = double(normxcorr_hw(hwid, 11, icp, rot90(sub_input,2), sum_T, denom_T));
 
53
    else
 
54
        norm_cross_corr = dic_normxcorr2(OPTIMIZE, hwid, icp, sub_input, base(icp), sum_T, denom_T);
 
55
    end
54
56
 
55
57
    % get subpixel resolution from cross correlation
56
58
    subpixel = true;