sustaining_gazes/matlab_version/pdm_generation/nrsfm-em/mstep_update_transl.m

23 lines
427 B
Mathematica
Raw Normal View History

2016-04-28 21:40:36 +02:00
function Tr = mstep_update_transl(P, S_bar, V, E_z, RO)
% Tr = mstep_update_transl(P, S_bar, V, E_z, RO)
% Updates translation using Eq 23
[K, T] = size(E_z);
J = size(S_bar, 2);
Tr = zeros(T, 2);
for t = 1:T,
Sdef = S_bar;
for kk = 1:K,
Sdef = Sdef + E_z(kk,t)*V((kk-1)*3+[1:3],:);
end;
R_t = RO{t};
XY = R_t(1:2,:)*Sdef;
t_t = sum(P([t t+T], :) - XY, 2)./J;
Tr(t, :) = t_t';
end