Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First, thanks for the nice example, it is really helpful.

Second, a question in order to include velocity the following modification, is enough:

int dim = 4; // including velocity
...
...
// including velocity
float minRange[] = { 0, 0, -1.0, -1.0 };
float maxRange[] = { xRange, yRange, 1.0, 1.0 };
CvMat LB, UB;
cvInitMatHeader(&LB, 4, 1, CV_32FC1, minRange);
cvInitMatHeader(&UB, 4, 1, CV_32FC1, maxRange);
...
...
// including velocity
condens->DynamMatr[0] = 1.0;
condens->DynamMatr[1] = 0.0;
condens->DynamMatr[2] = 1.0;
condens->DynamMatr[3] = 0.0;

condens->DynamMatr[4] = 0.0;
condens->DynamMatr[5] = 1.0;
condens->DynamMatr[6] = 0.0;
condens->DynamMatr[7] = 1.0;

condens->DynamMatr[8] = 0.0;
condens->DynamMatr[9] = 0.0;
condens->DynamMatr[10] = 1.0;
condens->DynamMatr[11] = 0.0;

condens->DynamMatr[12] = 0.0;
condens->DynamMatr[13] = 0.0;
condens->DynamMatr[14] = 0.0;
condens->DynamMatr[15] = 1.0;