
load data_file -ascii
x = (data_file(:,1))';
y = (data_file(:,2))';
flow = (data_file(:, 3:4))';

fl = 1;		% focal length

% Kanatani-A
[est_trans, est_rot] = biased(fl, x, y, flow);

% Kanatani-B
[est_trans, est_rot] = renormalize(fl, x, y, flow);

% linear-subspace
est_trans = subspace_trans(fl, x, y, flow);

init_trans = [0 0.5 1];

% Tomasi
[est_trans, converge] = Tomasi([x' y']/fl, flow'/fl, init_trans');

% bilinear
[est_trans, converge] = bilinear_subspace(fl, x, y, flow, init_trans);

init_rot = [0 0 0.003];

% Prazdny
[est_rot, converge] = prazdny(fl, x, y, flow, init_rot);

% Estimate translation from known rotation
est_trans = Estimate_trans(fl,x,y,flow,est_rot);

% Estimate rotation from known translation
est_rot = Estimate_rot(fl, x', y', flow, est_trans);
