Page 1 of 1

TT_UpdateSingleFrame() question

Posted: Tue Jan 12, 2010 12:24 pm
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?

Re: TT_UpdateSingleFrame() question

Posted: Tue Jan 12, 2010 1:53 pm
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.

Re: TT_UpdateSingleFrame() question

Posted: Wed Feb 03, 2010 6:16 pm
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?

Re: TT_UpdateSingleFrame() question

Posted: Mon Feb 08, 2010 11:03 am
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)