-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatures_p_FinA_from_frame1_frame2.m
72 lines (34 loc) · 1.35 KB
/
features_p_FinA_from_frame1_frame2.m
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
function features=features_p_FinA_from_frame1_frame2(features,map_camera_times,cam_id1,cam_id2,frame1,frame2,R1,T1,R2,T2)
timestamp1=map_camera_times(frame1,1)-map_camera_times(frame1,3);
timestamp2=map_camera_times(frame2,1)-map_camera_times(frame2,3);
ids_all = keys(features);
for i = 1:length(ids_all)
id = ids_all{i}; % 获取当前键
feat = features(id);
frame1_timestamps=0;
if size(feat.timestamps{cam_id1},1)>1
for j=1:size(feat.timestamps{cam_id1},1)
if timestamp1==feat.timestamps{cam_id1}(j)
frame1_timestamps=j;
end
end
end
frame2_timestamps=0;
if size(feat.timestamps{cam_id2},1)>1
for j=1:size(feat.timestamps{cam_id2},1)
if timestamp2==feat.timestamps{cam_id2}(j)
frame2_timestamps=j;
end
end
end
if frame1_timestamps~=0 && frame2_timestamps~=0
U1=[feat.uvs_norm{cam_id1}(frame1_timestamps,1);feat.uvs_norm{cam_id1}(frame1_timestamps,2);1];
U2=[feat.uvs_norm{cam_id2}(frame2_timestamps,1);feat.uvs_norm{cam_id2}(frame2_timestamps,2);1];
A=[Skew_symmetric(R1*U1);Skew_symmetric(R2*U2)];
b=[Skew_symmetric(R1*U1)*T1;Skew_symmetric(R2*U2)*T2];
X=A\b;
feat.p_FinA=X;
end
features(id)=feat;
end
end