forked from senecobis/VA4MR-visual-odometry-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalcScalingFactor.m
More file actions
35 lines (27 loc) · 961 Bytes
/
Copy pathCalcScalingFactor.m
File metadata and controls
35 lines (27 loc) · 961 Bytes
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
27
28
29
30
31
32
33
34
35
function [s] = CalcScalingFactor(ds,img_num, T_w_c0, T_first,s)
if ds == 2 && img_num == 105
%parking
% the average width of a land rover is 1.8 meters
relative_trasl = T_w_c0(1:3,end) - T_first(1:3,end);
rel_trasf_frames = relative_trasl / 1.8;
% ideally should be 1
s = max(rel_trasf_frames/5);
elseif ds == 1 && img_num == 99
%Malaga
% it sees a car at frame 95
% the average lenght of a Seat ibiza is 4.059 meters
relative_trasl = T_w_c0(1:3,end) - T_first(1:3,end);
rel_trasf_frames = relative_trasl / 4.059;
% ideally should be 1
s = max(rel_trasf_frames/4);
elseif ds == 0 && img_num == 43
%Kitti
% the average width of a Ww wagon is 2 meters
relative_trasl = T_w_c0(1:3,end) - T_first(1:3,end);
rel_trasf_frames = relative_trasl / 2;
% ideally should be 1
s = max(rel_trasf_frames/3);
else
s = s;
end
end