Tracking is difficult in situations such as the particle leaves the field of view and then re-enters (is it the same particle, or a different one), or two particles overlap (which one went where?).
For each frame, you can find the centroids and store them. To label them you might try to find the distance of each centroid to the centroids of the prior frames and label each particle in the new frame with the label of the particle closest to it from the prior frame. Sorry - tracking is complicated code and I don't have any demo for you.
Best Answer