Great, thanks! One more question. When you said in the other thread about the correct tools for a certain problem, that got me thinking on how I recognize the outline of the moving objects. That part is done again with a blow torch and a hammer:
- Convert each frame to grayscale
- Apply an absDiff() on two consecutive frames.
- Apply a Cloe morphological transformation on the diff
- Binary threshold to a value which seems to give out decent results
- Apply a blur transformation
It’s not ideal, but it works. Main problem is getting a “tail” on the position of the object in the current frame and the fact that the outline is not always consistent - depending on the color of the object.
Here’s a few pictures of the objects being tracked. Getting the outline right (especially at the bottom of the object) is critical. Obj1, obj2