summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/toolbox/toolbox_basic/affine/iter_AD.m
blob: 50bdae11791dcfab0ad4c300120f98a1515e62ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function [A,D] = iter_AD(I,J,mask,w,k,num_trans)
%
%  function [A,D] = iter_AD(I,J,mask,w,k,num_trans)
%
%  find the affine motion A, and displacement D,
%  such that difference between I(Ax-D) and J(x) is minimized.
%  If k <= num_trans, only translation is computed.  This is useful
%  in practice, when translation is relative large.
%
%  mask: the weight matrix,
%  w: window size for estimating gradiant, use a large value
%     when A,D are large.
%

%
%  Jianbo Shi
%


if k <= num_trans,
  D = find_D(I,J,mask,w);
  A = eye(2);
else
  [A,D] = find_AD(I,J,mask,w);
end