How do I track multiple objects with high precision.
September 17, 2010 6:32 PM   Subscribe

How should I go about tracking multiple objects in an environment requiring high precision? Is what I'd like to do even possible?

I'm helping conduct an experiment that involves measuring responses in a linear flow column/box/thingy. The setup involves a ~500cm by ~10cm by ~4cm(height) opened topped box. Inside of the column are 6 objects that always start at fixed positions evenly dispersed throughout. Over the course of two hours these objects move throughout the box and remain within it occasionally crossing paths or overlapping, the movement of the objects rarely exceeds a displacement of 100cm. We have a group of people who run trials on a daily basis but the process is time consuming. Even with multiple apparatuses running, the data collection is slow and tedious along with the data being error prone (it wouldn't be data collection otherwise).

I have some experience programming in python and a little in C (know the syntax) but not to the point where I am comfortable programming any idea that might come to mind. I'm fine with learning while doing the project, that's partially one of the goals. My first idea was to use a high resolution camera perpendicular to the column that takes pictures at an interval and identifies the objects (high contrast luckily). I figured I could create array of points for each object and track it's movement. Unfortunately the objects are irregular in size and sometimes tumble in space. Coupled with an overlapping scenario that I would only know how to remedy by subtracting one point array from another I don't know if it would be too accurate nor have I thought through the scenario to see if I could get a reliable position. The end product would be to calculate vectors over a specific time interval for all objects and return in a csv format (which I can do!). The second idea involves using opencv and it seems like it might me more applicable for this situation without having to rewrite the world but I'm unsure of some of the options and the documentation is slightly beyond me, could you suggest some resources?

Finally, I haven't looked into hardware but could I expect a precision close to a centimeter (lower the better) assuming a high contrast without having to break the bank in terms of imaging equipment? Would video be more applicableI'm going to try a proof of concept sometime next week with a point-and-shoot.

That was relatively long winded and had a bunch of questions but I appreciate any suggestions.
posted by EsotericAlgorithm to Technology (6 answers total) 1 user marked this as a favorite
 
OpenCV sounds like a good solution to me. It's probably a fairly easy problem if you can make the objects have distinct colors from each other. However, be sure to consider the difficulty of writing a completely automated solution compared with a semiautomated solution. Maybe data collection would be easier if you made videos and reviewed them later with the benefits of rewind and fast forward? Maybe object tracking during overlaps would be easier if you had a human to disambiguate things. How fast are these objects moving?
posted by demiurge at 6:45 PM on September 17, 2010


Distinct colours might be possible but the objects are randomly pulled samples and the color would have to be removed between trials. I'll add that the objects are alive and have tags that differentiate them. Would a rfid tag be possible to get position. I've found some stuff on it but nothing conclusive on measuring one dimension.

Maybe data collection would be easier if you made videos and reviewed them later with the benefits of rewind and fast forward?

The data collection with videos really does seem like a great option. The setup between trials is fairly laborious and unlikely to be automated so a semiautomated solutions is likely the best option, but I'm not sure how I'd dispatch the workflow. Shouldn't be too hard. The issue with videos instead of images is money spent on disk space. Whereas images every minute (for example) are pretty cheap.


How fast are these objects moving?

Irregular movement with lots of stops (sometimes no movement for the whole trial). Don't have the data on me at the moment but I'd estimate 15cm/hr although it can be rather bursty movement. One out of 5 trials we might get an outlier that does 150cm/hr.
posted by EsotericAlgorithm at 7:16 PM on September 17, 2010


That's pretty slow, so I would figure out the minimum frame rate you need to take pictures at and then capture the images and compress them into a movie for ease of use. Disk space shouldn't be an issue with 2TB drives being less than $150. Taking advantage of the fact that most of the image isn't going to be changing an awful lot should make compression that much better.

You'll need this sort of setup to start out for your automated object detection anyway, so using it for manual video review is a good first step.
posted by demiurge at 7:38 PM on September 17, 2010


The problem with compression is I might get an unacceptable loss of resolution in terms of measuring movement, but if that is possible it's a good idea; I hadn't considered compression though thanks for the advice. If compression wasn't possible uncompressed HD could get pretty out of control with a high framerate. On seconds thought you're right, as most of the tracking algorithms are of videos anyways, definition problem on my part. I'm excited this seems to be easily (relatively) doable. Now to determine which optical flow model will work best. Time to fiddle with the numbers. Thanks!
posted by EsotericAlgorithm at 8:39 PM on September 17, 2010


RFID tags will not give you any data about position or orientation. The signal returning from an RFID tag can bounce around a lot making them hard to triangulate. The best work I have seen in localization of RFID is maybe on the order of sub meter resolution.

If you could clarify how many dimensions of data you need I could propose a solution. It may also be easier if state specifically what you want to track. Are we talking about fish, bugs, snails? What the tracked object is really does matter to an extent. Also tracking things in 2D space and 3D space with cameras are very different things. If all you need to do is track the (x,y) position of the animal that is fairly straight forward.

If you are tracking animals in 3D space I would forget about tracking your objects with centimeter or sub-centimeter accuracy with a single camera unless you can affix something rigid to the animal (like a tag). I would hold off worrying about the resolution of the system until you have a solution that works, then if you need better results you can always get a better camera. Optical flow is not that robust for tracking, even with high definition video, and it won't solve your occlusion problems. You may want to look into using ARToolKit as a starting point. You can print the ARToolkit fiducials/tags on stickers and just attach them to the animal you want to track. My experience tells me that you will probably get a tracking accuracy of around 5% of the distance you are tracking over and the size of the fiducial. This will at least give you a 3D solution but it won't solve your occlusion problem (i.e. one animal walking in front of another).

We can take this offline if you want.
posted by kscottz at 9:51 PM on September 18, 2010


2D space, in fact one-dimension is all that's needed, just response along a linear path. For all intents and purposes they could be equated to snails (I don't have to be intentionally vague, I just started that way and would like to continue it out of stubbornness). The ARToolkit looks to be promising but we currently have a tagging system implemented and I'm not sure if I want to supplant it just yet. Could you speak to the accuracy of using optical flow in terms of accuracy in 2D or 1D space? Or better yet another method? In essence I guess I don't need anything complex just to identify the locations where contrast changes dramatically and someway to tell when they overlap, which may or may not be possible.
posted by EsotericAlgorithm at 8:41 AM on September 20, 2010


« Older Help me find movies with "shell game" scenes.   |   Funky Furniture Finds Newer »
This thread is closed to new comments.