1
- function [P_store ,z_inverse ] = kalman_filter(m ,P ,A ,Q ,L ,R , timeSteps ,number_of_frames, smoothing, q_given )
1
+ function [P_store ,z_inverse ] = kalman_filter(m ,P ,A ,Q ,L ,R , timeSteps ,number_of_frames, smoothing)
2
2
P_store = cell(0 );
3
3
z_inverse = cell(0 );
4
- if not(q_given )
5
- q_values = Q ;
6
- end
7
- h = zef_waitbar(0 , ' Filtering' );
4
+ h = zef_waitbar(0 ,1 , ' Filtering' );
8
5
for f_ind = 1 : number_of_frames
9
- zef_waitbar(f_ind / number_of_frames ,h ,...
6
+ zef_waitbar(f_ind , number_of_frames ,h ,...
10
7
[' Filtering ' int2str(f_ind ) ' of ' int2str(number_of_frames ) ' .' ]);
11
8
f = timeSteps{f_ind };
12
- if not(q_given )
13
- Q = diag(q_values(: ,f_ind ));
14
- end
15
9
% Prediction
16
- % [m,P] = zeffiro.plugins.Kalman.m.kf_predict(m, P, A, Q);
17
10
[m ,P ] = kf_predict(m , P , A , Q );
18
11
% Update
19
- % [m, P] = zeffiro.plugins.Kalman.m.kf_update(m, P, f, L, R);
20
12
[m , P ] = kf_update(m , P , f , L , R );
21
13
if (smoothing == 2 )
22
14
P_store{f_ind } = gather(P );
23
15
end
24
16
z_inverse{f_ind } = gather(m );
25
17
end
26
18
close(h );
27
- end
19
+ end
0 commit comments