OpenCV 4.5.3(日本語機械翻訳)
kalman_filters.hpp
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
8 //
9 //
10 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2015, OpenCV Foundation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
15 //
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
18 //
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
21 //
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
25 //
26 // * The name of the copyright holders may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 //M*/
41
42 #ifndef __OPENCV_TRACKING_KALMAN_HPP_
43 #define __OPENCV_TRACKING_KALMAN_HPP_
44
45 #include "opencv2/core.hpp"
46 #include <limits>
47
48 namespace cv {
49 namespace detail {
50 inline namespace tracking {
51
54
55 inline namespace kalman_filters {
56
59 class CV_EXPORTS UnscentedKalmanFilter
60{
61 public:
62
63 virtual ~UnscentedKalmanFilter(){}
64
69 virtual Mat predict( InputArray control = noArray() ) = 0;
70
75 virtual Mat correct( InputArray measurement ) = 0;
76
80 virtual Mat getProcessNoiseCov() const = 0;
81
85 virtual Mat getMeasurementNoiseCov() const = 0;
86
90 virtual Mat getErrorCov() const = 0;
91
95 virtual Mat getState() const = 0;
96};
97
102 class CV_EXPORTS UkfSystemModel
103{
104 public:
105
106 virtual ~UkfSystemModel(){}
107
114 virtual void stateConversionFunction( const Mat& x_k, const Mat& u_k, const Mat& v_k, Mat& x_kplus1 ) = 0;
120 virtual void measurementFunction( const Mat& x_k, const Mat& n_k, Mat& z_k ) = 0;
121};
122
123
128{
129 public:
130
131 int DP;
132 int MP;
133 int CP;
135
138
141
142 // Parameters of algorithm
143 double alpha;
144 double k;
145 double beta;
146
147 //Dynamical system model
149
153
163 UnscentedKalmanFilterParams( int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag,
164 Ptr<UkfSystemModel> dynamicalSystem, int type = CV_64F );
165
175 void init( int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag,
176 Ptr<UkfSystemModel> dynamicalSystem, int type = CV_64F );
177};
178
183{
184 public:
185
187
197 AugmentedUnscentedKalmanFilterParams( int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag,
198 Ptr<UkfSystemModel> dynamicalSystem, int type = CV_64F );
199
209 void init( int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag,
210 Ptr<UkfSystemModel> dynamicalSystem, int type = CV_64F );
211};
212
219CV_EXPORTS Ptr<UnscentedKalmanFilter> createUnscentedKalmanFilter( const UnscentedKalmanFilterParams &params );
227CV_EXPORTS Ptr<UnscentedKalmanFilter> createAugmentedUnscentedKalmanFilter( const AugmentedUnscentedKalmanFilterParams &params );
228
229} // namespace
230
232
233}}} // namespace
234
235 #endif
n-dimensional dense array class
Definition: mat.hpp:802
Augmented Unscented Kalman filter parameters. The class for initialization parameters of Augmented Un...
Definition: kalman_filters.hpp:183
AugmentedUnscentedKalmanFilterParams(int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag, Ptr< UkfSystemModel > dynamicalSystem, int type=CV_64F)
void init(int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag, Ptr< UkfSystemModel > dynamicalSystem, int type=CV_64F)
Model of dynamical system for Unscented Kalman filter. The interface for dynamical system model....
Definition: kalman_filters.hpp:103
virtual void measurementFunction(const Mat &x_k, const Mat &n_k, Mat &z_k)=0
virtual void stateConversionFunction(const Mat &x_k, const Mat &u_k, const Mat &v_k, Mat &x_kplus1)=0
The interface for Unscented Kalman filter and Augmented Unscented Kalman filter.
Definition: kalman_filters.hpp:60
virtual Mat correct(InputArray measurement)=0
virtual Mat predict(InputArray control=noArray())=0
Unscented Kalman filter parameters. The class for initialization parameters of Unscented Kalman filte...
Definition: kalman_filters.hpp:128
double k
Default is 0.
Definition: kalman_filters.hpp:144
int CP
Dimensionality of the control vector.
Definition: kalman_filters.hpp:133
double alpha
Default is 1e-3.
Definition: kalman_filters.hpp:143
void init(int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag, Ptr< UkfSystemModel > dynamicalSystem, int type=CV_64F)
Mat errorCovInit
State estimate cross-covariance matrix, DP x DP, default is identity.
Definition: kalman_filters.hpp:137
Ptr< UkfSystemModel > model
Object of the class containing functions for computing the next state and the measurement.
Definition: kalman_filters.hpp:148
UnscentedKalmanFilterParams(int dp, int mp, int cp, double processNoiseCovDiag, double measurementNoiseCovDiag, Ptr< UkfSystemModel > dynamicalSystem, int type=CV_64F)
int DP
Dimensionality of the state vector.
Definition: kalman_filters.hpp:131
Mat measurementNoiseCov
Measurement noise cross-covariance matrix, MP x MP.
Definition: kalman_filters.hpp:140
UnscentedKalmanFilterParams()
Definition: kalman_filters.hpp:152
int MP
Dimensionality of the measurement vector.
Definition: kalman_filters.hpp:132
int dataType
Type of elements of vectors and matrices, default is CV_64F.
Definition: kalman_filters.hpp:134
Mat processNoiseCov
Process noise cross-covariance matrix, DP x DP.
Definition: kalman_filters.hpp:139
Mat stateInit
Initial state, DP x 1, default is zero.
Definition: kalman_filters.hpp:136
double beta
Default is 2.0.
Definition: kalman_filters.hpp:145
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74