Filter#
FilterPyKalmanFilterFactory
#
Bases: FilterFactory
This class can be used either to change some parameters of the KalmanFilter that the tracker uses, or to fully customize the predictive filter implementation to use (as long as the methods and properties are compatible).
The former case only requires changing the default parameters upon tracker creation: tracker = Tracker(..., filter_factory=FilterPyKalmanFilterFactory(R=100))
,
while the latter requires creating your own class extending FilterPyKalmanFilterFactory
, and rewriting its create_filter
method to return your own customized filter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
R |
float
|
Multiplier for the sensor measurement noise matrix, by default 4.0 |
4.0
|
Q |
float
|
Multiplier for the process uncertainty, by default 0.1 |
0.1
|
P |
float
|
Multiplier for the initial covariance matrix estimation, only in the entries that correspond to position (not speed) variables, by default 10.0 |
10.0
|
See Also
Source code in norfair/filter.py
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 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
create_filter(initial_detection)
#
This method returns a new predictive filter instance with the current setup, to be used by each new TrackedObject
that is created.
This predictive filter will be used to estimate speed and future positions of the object, to better match the detections during its trajectory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
initial_detection |
ndarray
|
numpy array of shape |
required |
Returns:
Type | Description |
---|---|
KalmanFilter
|
The kalman filter |
Source code in norfair/filter.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
OptimizedKalmanFilterFactory
#
Bases: FilterFactory
Creates faster Filters than FilterPyKalmanFilterFactory
.
It allows the user to create Kalman Filter optimized for tracking and set its parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
R |
float
|
Multiplier for the sensor measurement noise matrix. |
4.0
|
Q |
float
|
Multiplier for the process uncertainty. |
0.1
|
pos_variance |
float
|
Multiplier for the initial covariance matrix estimation, only in the entries that correspond to position (not speed) variables. |
10
|
pos_vel_covariance |
float
|
Multiplier for the initial covariance matrix estimation, only in the entries that correspond to the covariance between position and speed. |
0
|
vel_variance |
float
|
Multiplier for the initial covariance matrix estimation, only in the entries that correspond to velocity (not position) variables. |
1
|
Source code in norfair/filter.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|