c++ - Kalman filter inside a struct and cannot initialize it -
i want track multiple objects using kalman filter. so, doing is, using struct define object's properties , kalman filter track points. (as follows)
struct sasparagus { int iid; int iframeid; int iwidth; int iheight; int ix; int iy; int iz; cv::kalmanfilter kf; // here defining kalman filter , cannot initialize. };
then in loop, trying assign values these properties.
(cvblobs::const_iterator = blobs.begin(); !=blobs.end();++it) { sasparagus sasp; sasp.iframeid = icounter; sasp.iwidth = (it->second->maxx - it->second->minx); sasp.iheight = (it->second->maxy - it->second->miny); sasp.ix = it->second->centroid.x; sasp.iy = it->second->centroid.y; sasp.kf(4, 2, 0); //here getting error vaspelements.push_back(sasp); }
when run, error follows.
no match call ‘(cv::kalmanfilter) (int, int, int)’ sasp.kf(4, 2, 0);
how can initialize kalman filter here ? approach right ? came see here (opencv kalman filter initialization error) approach multiple objects tracking using kalman filter. going wrong ?
sasp.kf(4, 2, 0);
cannot used kf
default constructed when sasparagus sasp;
. cannot call constructor on constructed object. can assign kf
temporary kalmanfilter
though like:
sasp.kf = cv::kalmanfilter(4, 2, 0);
or use init()
like
sasp.kf.init(4, 2, 0);
Comments
Post a Comment