Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

your particle initialization here

//Initializing the particles
std::vector<cv::Mat> particle(N, cv::Mat(4, 1, CV_32F));

unfortunately makes all particles point to the same Mat-data. instead:

std::vector<cv::Mat> particle(N);
for (int i = 0; i < N; i++)
{
    particle[i] = cv::Mat::zeros(4, 1, CV_32F)
}