Which frame is output after call to TT_Update()

Post Reply
baggepinnen
Posts: 9
Joined: Tue Oct 30, 2012 6:03 pm

Which frame is output after call to TT_Update()

Post by baggepinnen » Thu Jan 31, 2013 5:49 pm

I wonder if lets say, I call function TT_Update for the first time in a few seconds and then instantly call TT_TrackableLocation, which frame will I be given, the latest recorded frame or the first recorded frame still in the buffer? Also, how does this differ from a call to TT_UpdateSingleFrame.

Lets also say that I call TT_Update very often so that when I call TT_TrackableLocation, the last call to TT_Update returned NO_FRAME_AVAILABLE, will I then receive the last recorded position or no position at all?

I find that the documentation on the API is somewhat unclear on this.

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Which frame is output after call to TT_Update()

Post by beckdo » Mon Feb 04, 2013 11:05 am

When you call TT_Update(), all frames that have queued up from not calling this function on a regular basis will be processed. The problem with this is that once the queue fills, new frames will no longer queue up. So after calling TT_Update(), you'll process the frames that were filling the queue and then TT_TrackableLocation() will give you the latest position based on those frames.

Calling TT_Update() on a regular basis is a requirement for proper functionality. You'll get bad tracking side effects if you try yo stop calling TT_Update() for some amount of time.

The only difference with TT_UpdateSingleFrame() is that it will only process a single group of incoming frames from the camera that correspond to a single shutter time. Cumulatively referred to as one 'frame'. This effectively allows you to get a trackable result for every frame rather than just the current frame. This might be useful if you were running a test where you were recording a trackable's path at 100 FPS and you absolutely wanted to make sure you received it's updated position for every 10ms.

Post Reply