I was asked about my vl port a bunch of times, so I here you go.
There are two vvvv plugin templates, one demonstrates a basic 2d case, the other demonstrates how to make a more involved Feature you want to track
This can be for example:
- touchpoints with changing 2d position and changing blob size, where the provided touch index is stable most of the time, but fails when it is most important
- cars, where you can track not only its position in the camera space, but maybe also its color, and whatever else you know)
- opencv rectangles that move and resize over time
It comes with the original help patch to test against jitter, random order and frame drops.
VL.Tracker.zip (65.7 KB)
Just to put it into context to @joreg 's patch - it will probably perform slightly slower, but it is much more stable in practice. Also, it does not rely on an actual Distance function for the feature you want to track, instead you are asked to fill out a delegate that calculates said distance (which is only a measure, of how far apart two things are from each other, not just in space, but also in appearance and other intrinsics).
In addition to that, you are also asked to provide a simple Smoothing delegate, as this smoothing is vitally important for the tracking algorithm. This is super easy most of the time, a simple Lerp should do it for most cases.