TT_UpdateSingleFrame() question

Post Reply
aghman
Posts: 22
Joined: Thu Apr 24, 2008 9:08 am
Location: Seattle, WA

TT_UpdateSingleFrame() question

Post by aghman »

I've got a quick question about getting camera data with TT_UpdateSingleFrame(). When this call is made, is this "single frame" from a single camera, or all available cameras? I'd like to have a call that I can get only a frame from a single camera (and then get 2D data from it). Is this the one to use?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: TT_UpdateSingleFrame() question

Post by beckdo »

When you call UpdateSingleFrame(), it will process one group of frames (which consists of exactly one frame from each camera). After calling UpdateSingleFrame() you can then call TT_CameraFrameBuffer to get the image data, or TT_CameraMarker to get the marker data for the camera's frame. Then call UpdateSingleFrame() to advance one frame, then get your frame data and repeat.

The only thing you need to watch out for with UpdateSingleFrame() is that you have to make sure you call it at least every 10ms or you'll get behind and ultimately drop frames.
aghman
Posts: 22
Joined: Thu Apr 24, 2008 9:08 am
Location: Seattle, WA

Re: TT_UpdateSingleFrame() question

Post by aghman »

One more question about UpdateSingleFrame:
I'm calling this function at least once every 2-5 milliseconds, with V100 cameras (100 hz). This means that, at best, there should be a frame available once every 5 milliseconds. However, I'm almost always getting successful returns(ie. NPRESULT_SUCCESS) from UpdateSingleFrame, even though there should be no new frames available that often. I'd expect to see NoFrameAvailable, or some other error to indicate that there is no new data available.
Is there some way to tell that there isn't a new frame available, or perhaps (even better) a way to get individual frame ids for each camera? Basically, I'm looking for a way to track frame progression, on a per-camera basis. Any ideas?
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: TT_UpdateSingleFrame() question

Post by beckdo »

TT_UpdateSingleFrame() will only return NPRESULT_SUCCESS if it processed a frame group of new data. TT_Update() will only return NPRESULT_SUCCESS if it has processed one or more frame groups of new data. It will return NPRESULT_NOFRAMEDATA (14) if there was no new data to be processed. I verified this functionality using the sample application.

You might want to confirm with a timer that you're actually calling the TT_UpdateSingleFrame() function as often as you think you are.

Also, a 100hz frame rate means there will be a new frame once every 10 milliseconds (1000 milliseconds / 100hz = 10)
Post Reply