I have a video of tracking particles that are moving in a frame and I would like to create an output with velocity tracks. I have been doing it via for each peak, connecting to all the peaks in the next rame and choosing the one with the least distance via mink and least diameter change (again using mink), This creates a track for the first peak in the first frame. I do this for all the peaks in each frame. I seem to however get overlapping connections. Is there any algorithm that does this automatically in matlab?