-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeatures_get_from_txt.m
53 lines (31 loc) · 1.05 KB
/
features_get_from_txt.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
function features=features_get_from_txt(file_name)
feature_txt=importdata(file_name);
features=containers.Map();
for i=1:size(feature_txt,1)
featid=feature_txt(i,1)+1;
cam_id=feature_txt(i,2)+1;
timestamps=feature_txt(i,3);
uvs_norm=feature_txt(i,4:5);
uvs=feature_txt(i,6:7);
feat=[];
if ~isKey(features,num2str(featid))
feat.timestamps{cam_id}=[];
feat.uvs_norm{cam_id}=[];
feat.uvs{cam_id}=[];
feat.p_FinA=[];
feat.p_FinG=[];
feat.featid=featid;
features(num2str(featid))=feat;
end
feat=features(num2str(featid));
if cam_id>size(feat.timestamps,2)
feat.timestamps{cam_id}=[];
feat.uvs_norm{cam_id}=[];
feat.uvs{cam_id}=[];
end
feat.timestamps{cam_id}=[feat.timestamps{cam_id};timestamps];
feat.uvs_norm{cam_id}=[feat.uvs_norm{cam_id};uvs_norm];
feat.uvs{cam_id}=[feat.uvs{cam_id};uvs];
features(num2str(featid))=feat;
end
end