-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecalib_remove_outlier.m
47 lines (44 loc) · 1.65 KB
/
recalib_remove_outlier.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
function recalib_remove_outlier()
is_updated = false;
while true
load('recalib_result');
for i=1:26
for j = 2:1160
idx = find(recalib_result{i}.theta(:,j) > mean(recalib_result{i}.theta(:,j)))';
if (((length(idx) >=65 || length(idx) <= 35) && abs(mean(recalib_result{i}.theta(:,j))) > 1 ) ...
|| ...
(length(idx) >=95 || length(idx) <= 5) && abs(mean(recalib_result{i}.theta(:,j))) > 1e-2)
d = sort(recalib_result{i}.theta(:,j));
if length(idx) >= 70
outlier_value = d(1);
else
outlier_value = d(end);
end
k = find(recalib_result{i}.theta(:,j)==outlier_value);
k = k(1);
[i,k]
recalib_result{i}.theta = recalib_result{i}.theta([1:k-1, k+1:end],:);
recalib_result{i}.phi = recalib_result{i}.phi([1:k-1, k+1:end],:);
is_updated = true;
break;
end
end
end
if is_updated == true
save('recalib_result', 'recalib_result');
else
if false
for i=1:26
clf;
i
subplot(2,1,1);
mesh(recalib_result{i}.theta);
subplot(2,1,2);
mesh(recalib_result{i}.phi);
pause;
end
end
break;
end
end
end