19#include <opencv2/video/tracking.hpp>
70 public jevois::Parameter<kalman4d::usevel, kalman4d::procnoise,
71 kalman4d::measnoise, kalman4d::postnoise>
75 Kalman4D(std::string
const & instance);
82 void set(
float x,
float y,
float w,
float h);
87 void set(
float x,
float y,
float w,
float h,
unsigned int imgwidth,
unsigned int imgheight);
96 void get(
float & x,
float & y,
float & w,
float &
h,
float const eps = 0.01F);
102 void get(
float & x,
float & y,
float & w,
float &
h,
unsigned int imgwidth,
unsigned int imgheight,
103 float const eps = 0.01F);
110 void get(
float & rawx,
float & rawy,
float & raww,
float & rawh,
float & imgx,
float & imgy,
111 float & imgw,
float & imgh,
unsigned int imgwidth,
unsigned int imgheight,
112 float const raweps = 0.01F,
float const imgeps = 0.01F);
119 void onParamChange(kalman4d::usevel
const & param,
bool const & newval)
override;
120 void onParamChange(kalman4d::procnoise
const & param,
float const & newval)
override;
121 void onParamChange(kalman4d::measnoise
const & param,
float const & newval)
override;
122 void onParamChange(kalman4d::postnoise
const & param,
float const & newval)
override;
Simple component to track a moving 2D box (position and size) over time using a Kalman filter.
void onParamChange(kalman4d::measnoise const ¶m, float const &newval) override
virtual ~Kalman4D()
Destructor.
void onParamChange(kalman4d::postnoise const ¶m, float const &newval) override
void get(float &x, float &y, float &w, float &h, float const eps=0.01F)
Function to call each time you want to get the Kalman-filtered coordinates.
void onParamChange(kalman4d::usevel const ¶m, bool 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.
void onParamChange(kalman4d::procnoise const ¶m, float const &newval) override
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(measnoise, float, "Measurement noise standard deviation", 0.05F, ParamCateg)
Parameter.
void set(float x, float y, float w, float h)
Function to call each time you have a new measurement (output from a vision algorithm)
cv::Mat const & getErrorCov() const
Get the latest error covariance matrix (errorCovPost). It is updated after each get() or set()
JEVOIS_DECLARE_PARAMETER_WITH_CALLBACK(postnoise, float, "A posteriori error estimate standard deviation", 0.3F, ParamCateg)
Parameter.