19#include <opencv2/video/tracking.hpp>
70 public jevois::Parameter<kalman2d::usevel, kalman2d::procnoise,
71 kalman2d::measnoise, kalman2d::postnoise>
75 Kalman2D(std::string
const & instance);
82 void set(
float x,
float y);
87 void set(
float x,
float y,
unsigned int imgwidth,
unsigned int imgheight);
96 void get(
float & x,
float & y,
float const eps = 0.01F);
102 void get(
float & x,
float & y,
unsigned int imgwidth,
unsigned int imgheight,
float const eps = 0.01F);
109 void get(
float & rawx,
float & rawy,
float & imgx,
float & imgy,
unsigned int imgwidth,
unsigned int imgheight,
110 float const raweps = 0.01F,
float const imgeps = 0.01F);
114 void onParamChange(kalman2d::usevel
const & param,
bool const & newval)
override;
115 void onParamChange(kalman2d::procnoise
const & param,
float const & newval)
override;
116 void onParamChange(kalman2d::measnoise
const & param,
float const & newval)
override;
117 void onParamChange(kalman2d::postnoise
const & param,
float const & newval)
override;
Simple component to track a moving 2D point over time using a Kalman filter.
void get(float &x, float &y, float const eps=0.01F)
Function to call each time you want to get the Kalman-filtered coordinates.
cv::Mat itsState
(x, y, xdot, ydot)
void onParamChange(kalman2d::measnoise const ¶m, float const &newval) override
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(usevel, bool, "Use velocity tracking, in addition to position", false, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(procnoise, float, "Process noise standard deviation", 0.003F, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(measnoise, float, "Measurement noise standard deviation", 0.05F, ParamCateg)
Parameter.
void onParamChange(kalman2d::procnoise const ¶m, float const &newval) override
void onParamChange(kalman2d::usevel const ¶m, bool const &newval) override
void onParamChange(kalman2d::postnoise const ¶m, float const &newval) override
void set(float x, float y)
Function to call each time you have a new measurement (output from a vision algorithm)
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(postnoise, float, "A posteriori error estimate standard deviation", 0.3F, ParamCateg)
Parameter.
virtual ~Kalman2D()
Destructor.