# I have many peaks in each frame of a video. Some of these peaks can disappear from FOV sometimes. is there any way I can track their centroids (which I got using using region props) and get their subsequent velocity.

1 view (last 30 days)
AAS on 9 Mar 2020
Commented: Image Analyst on 9 Mar 2020
N/A

Image Analyst on 9 Mar 2020
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.

AAS on 9 Mar 2020
Do you know if I can use a certain search window on peaks found in n-1 on n..that is if I find 5 peaks in frame 1, and 4 peaks in frame 2 , I can track the four peaks using a search window of a certain dimension because I know the true velocity hence I know the distance they must travel(which should be the dimension of the search window). I am just not able to do the macroblock window searching on another frame.
Image Analyst on 9 Mar 2020
Like I said, it can get really complicated. If you have 5 in frame 1 and 4 in frame 2, you can look at both the distance of all the points to each point, and their velocities. It's possible if the velocities are high, that what is closest may not be the same particle. So you need to consider their velocities also and if the velocities are not close then either the particle changed speed or it's a different particle. Then to make it even more complicated you might consider the size and shape of the particles and if they don't match you have some decisions to make. Like I said, it can get very complicated. You might have to make up a feature vector for each particle and compare feature vectors for an overall guess on the particle : if it's one of the prior ones (and if so, which one), or it's a new one. Perhaps you can find some open source tracking code, but I certainly don't have any.