Multi-object tracking

Post Reply
EvoBot
Posts: 2
Joined: Wed Apr 27, 2005 5:00 am

Multi-object tracking

Post by EvoBot » Wed Apr 27, 2005 4:55 am

I am working on a project that requires simultaneous tracking of three distinct objects. As far as I can make out, the sample code that is available for the OptiTrack camera allows for tracking only one object at a time, even though multiple objects will show up on the display. Working with the v6 (C++ ) code, I have been looking through the files in an attempt to assess what factors contribute to assigning a color to an object to be tracked, and more broadly what handles tracking. Does anyone know of ways of adapting the sample code to track three objects at once or even of available C++ source that does this?

Any help will be much appreciated. Thank you.

Birch
Posts: 1139
Joined: Thu Jan 30, 2003 5:00 am
Location: Corvallis, Oregon

Re: Multi-object tracking

Post by Birch » Wed Apr 27, 2005 6:17 am

Hello,

It is definitely possible to access information about more than one object in a camera frame.

In the VC6 sample, the UpdateDotInfo() function provides an excellent example of how to get the properties for all objects in the camera frame.
In the case of the sample application, it loops through and only displays information when it finds the object with the highest rank.

The colors used in the camera data view image are assigned based on the rank of each individual object. The rank of an object is determined by the tracking parameters that are applied to all tracked objects such as object size, promiximity to other objects, whether it is static (non-moving) or not, etc.

If you wish to use the built in tracking/ranking system, then the tracking parameters should be modified to reflect the ideal characteristics of the objects you are tracking. There is specific information about all of these parameters in section 4.0.2.2.9 and 4.0.2.2.10 in the OptiTrack Manual version 1.0

If you do not wish to use the built in implementation, you can also access the individual objects and sort them using your own algorithms.

[ April 27, 2005, 01:22 PM: Message edited by: NaturalPoint - Birch Zimmer ]

EvoBot
Posts: 2
Joined: Wed Apr 27, 2005 5:00 am

Re: Multi-object tracking

Post by EvoBot » Sat Apr 30, 2005 7:07 am

Thank you for the information, I actually had been looking in UpdateDotInfo. I have not actually tried adding code to allow for the tracking of multiple objects yet (although it appears as though adding further instantiations of CComPtr s and varX and varYs should take care of that), but I have tried logging the data (x and y coordinates) for a single dot.

What I am doing is within the conditional if(lRank == 1), I am pushing back the varX.dblVal and varYdblVal onto a vector of time Coordinate (which is a class I�ve defined myself that simply takes in the constructor parameters and x and y value). Then, outside of the for loop that goes from 0 to lCount, I create my own for loop that iterates through the vector and writes the contents to a txt file. What happens (as may not surprise you), is that only the last value registered by the camera is recorded, and indeed that is the single value that exists in the vector.
The thing that perplexes me about this is the same thing that perplexes me with respect to how it is that the camera is capable of coming up with more than one set of values for a dot. I can find no loops that would account for such an iterative process. It occurs to me that perhaps the process is not iterative. My question then is whether it is possible to access a series of x, y coordinate data for a dot from the time �Start� is pressed to the time �Stop� is pressed.

ericd
Posts: 142
Joined: Thu Nov 04, 2004 5:00 am
Location: Portland, OR

Re: Multi-object tracking

Post by ericd » Sat Apr 30, 2005 11:16 am

If you don't mind, you could post your code here or email it to ericd@naturalpoint.com. I'll take a look at it and see what's going on.

Thanks!

Post Reply