quantumjot / btrack

Bayesian multi-object tracking
https://btrack.readthedocs.io
MIT License
310 stars 50 forks source link

[FEATURE REQUEST] Vector field to aid tracking #400

Open henriquenunez opened 5 months ago

henriquenunez commented 5 months ago

This tool is amazing! So easy to use, and fast!

I would like to know if there is any possibility to add some speed vectors, specially for tracking in non-static environments. How hard would it be? If developer count is a problem, maybe I can try implementing that, with some guidance from the maintainers.

Let me know

quantumjot commented 5 months ago

Hi @henriquenunez - thanks for the feedback!

This is a great idea, and I know that @lupinthief was interested in something similar.

I don't have much bandwidth to tackle this at the moment, but if you're interested in implementing it, I would welcome the contribution. The Kalman filters can be modified to have a "control vector" added, which might be a good place to start:

https://github.com/quantumjot/btrack/blob/8632533fee1c1ad1352d5817b84ff13478f324ec/btrack/include/motion.h#L33-L48

henriquenunez commented 4 months ago

Hello, thank you for the reply and sorry for the delay!

So, I got a bit more acquaintance to the code organization, and since my idea is to have a fector field to serve as the control for the motion model, a logical approach would be to pass this vector field to BayesianTracker::set_motion_model, and tweaking MotionModel::update to use this field to estimate the next x_hat. Do you suggest making it in another way?

I also did not have time to inspect that much the linkage and TrackManager, would it require some change as well?

quantumjot commented 4 months ago

Yes, that sounds very reasonable!

I don't think the TrackManager should need any modification, just the MotionModel.

lupinthief commented 3 months ago

My use-case currently runs without the motion model at all, but might the implementation of a vector field offer an opportunity to define an irregular domain within which motion can occur? In my case, everything has to be in the sea in order to move at all. Maybe this could be represented by very strong priors against particular (land) locations? Possibly naive, but thought I'd mention it.

henriquenunez commented 2 months ago

Hey,

As another thing I would like to ask is if there is a way you would suggest to aid a vector field. I believe that adding a vector map at this point, and then interpolate it, would be a good approach. A data structure specific to the vector field would have to be created then. Any ideas?

And also, @quantumjot I made a small tool to perform annotation on this type of dataset, and will help me compare if adding the vectors is actually helping the tracking or not. Hopefully I will have some results soon!