The operator read_kalmanread_kalmanReadKalmanread_kalmanReadKalmanReadKalman reads the description file
FileNameFileNameFileNameFileNameFileNamefileName of a Kalman filter. Kalman filters return an
estimate of the current state (or even the prediction of a future state)
of a discrete, stochastically disturbed, linear system. They are
successfully used in image processing, especially in the analysis of
image sequences. A Kalman filtering is based on a mathematical model
of the system to be examined which at any point in time has the following
characteristics:
Model parameter:
transition matrix A, control matrix G including
the controller output u and the measurement matrix C
Model stochastic:
system-error covariance matrix Q,
system-error - measurement-error covariance matrix L
and measurement-error covariance matrix R
Estimate of the initial state of the system:
state and corresponding covariance matrix
Many systems do not need entries “from outside”, and therefore G
and u can be dropped. Further, system errors and measurement
errors are normally not correlated (L is dropped). The
characteristics mentioned above can be stored in an ASCII-file and then
can be read with the help of the operator read_kalmanread_kalmanReadKalmanread_kalmanReadKalmanReadKalman.
This ASCII-file must have the following structure:
Dimension row
+ content row
+ matrix A
+ matrix C
+ matrix Q
[ + matrix G + vector u ]
[ + matrix L ]
+ matrix R
[ + matrix P0 ]
[ + vector x0 ]
The dimension row thereby is always of the following form:
n = <integer> m = <integer> p = <integer>
whereby n indicates the number of the state variables, m the number
of the measurement values and p the number of the controller members
(see also DimensionDimensionDimensionDimensionDimensiondimension). The maximal dimension will hereby
be limited by a system constant (= 30 for the time being).
The content row has the following form:
A*C*Q*G*u*L*R*P*x*
and describes the following content of the file. Instead of '*',
'+' (= parameter is available) respectively '-' (= parameter is missing)
have to be set. Please note that only the parameters marked by [...] in the
above list may be left out in the description file. If the initial state
estimate is missing (i.e. 'x-'), the components of the
vector will supposed to be 0.0. If the covariance matrix of
the initial state estimate is missing (i.e. 'P-'), the error will be
supposed to be tremendous. In this case the matrix elements will be set
to 10000.0. This value seems to be very high, however, it is only sufficient
if the range of components of the state vector x is smaller to the
tenth power.
(r x s) matrices will be stored per row in the following
form:
(the spaces and line feed characters can be chosen at will),
vectors will be stored correspondingly in the following form:
The following parameter values are returned by the operator
read_kalmanread_kalmanReadKalmanread_kalmanReadKalmanReadKalman:
This parameter includes the dimensions of the status vector, the
measurement vector and the controller vector. DimensionDimensionDimensionDimensionDimensiondimension
thereby is a vector [n,m,p], whereby
n indicates the number of the state variables,
m the number of the measurement values and
p the number of the controller members.
For a system without determining control
(i.e. without influence “from outside”) therefore
DimensionDimensionDimensionDimensionDimensiondimension = [n,m,0].
This parameter includes the lined up matrices (vectors)
A, C, Q, G, u and (if necessary)
L having been stored in row-major order.
ModelModelModelModelModelmodel therefore is a vector of the length
n*n + n*m + n*n + n*p + p [+ n*m].
The last summand is dropped, in case the system errors and measurement
errors are not correlated, i.e. there is no value for L.
This parameter includes the matrix (the error
covariance matrix of the initial state estimate) and the initial state
estimate lined up. This means, it is a vector of the
length n*n + n.
If the description file is readable and correct, the operator
read_kalmanread_kalmanReadKalmanread_kalmanReadKalmanReadKalman returns the value 2 (H_MSG_TRUE). Otherwise an exception is
raised.