Question

I implemented a bootstrap Particle filter on C++ by reading few Papers and I first implemented a 1D mouse tracker which performed really well. I used normal Gaussian for weighting in this exam.

I extended the algorithm to track face using 2 features of Local motion and HSV 32 bin Histogram. In this example my weighing function becomes the probability of Motion x probability of Histogram. (Is this correct).

Incase if that is correct than I am confused on the resampling function. At the moment my resampling function is as follows:

For each Particle N = 50;

Compute CDF Generate a random number (via Gaussian) X Update the particle at index X Repeat for all N particles. This is my re-sampling function at the moment. Note: the second step I am using a Random Number via Gaussian distribution for get the index while my weighting function is Probability of Motion and Histogram.

My question is: Should I generate random number using the probability of Motion and Histogram or just the random number via Gaussian is ok.

Was it helpful?

Solution

In the SIR (Sequential Importance Resampling) particle filter, resampling aims to replicate particles that have gained high weight, while remove those with less weight.

So, when you have your particles weighted (typically with the likelihood you have used), one way to do resampling is to create the cumulative distribution of the weights, and then generate a random number following a uniform distribution and pick the particle corresponding to the slot of the CDF. This way there is more probability to select a particle that has more weight.

Also, don't forget to add some noise after generating replicas of particles, otherwise your point-estimate might be biased for a period of time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top