c++ - KalmanFilter Tracking in openCV - Program received signal SIGSEGV -
i wanted test kalmanfilter tracking purposes , found several tutorials pretty similar overall (as initializing opencvs kalmanfilter , setting parameters).
i went after implementation: https://github.com/screename/kalman-filter-tracker/blob/master/kalmanfiltertracker.ccp
i'm having problem testing though because whenever start programme crashes. there's no build-errors when start debugging shows short message of "program received signal sigsegv - segmentation fault.
the phone call stack shows there's problems mat.hpp in line 574:
int = i0/cols, j = i0 - i*cols;
and @ line 1043:
template<typename _tp> inline _tp& mat_<_tp>::operator ()(int i0) { homecoming this->at<_tp>(i0); }
within kalmanfilter class these lines seem troubling:
measurement(0) = x; measurement(1) = y;
with
mat_<float> measurement;
and initializing with
measurement(2, 1); measurement.setto(scalar(0));
any thought on might causing problems here and/or how prepare it? tried few things before haven't found cause far. appreciate help.
i bet wanted:
mat_<float> measurement(2, 1); // alloc 2 rows, 1 col measurement.setto(scalar(0));
not:
mat_<float> measurement; // *empty* mat. measurement(2, 1); // invalid access on *empty* mat (would out of bounds, too)
c++ opencv segmentation-fault sigsegv
No comments:
Post a Comment