Dropped Frames and New SDK

Post Reply
avelazquez
Posts: 19
Joined: Mon Jun 07, 2010 7:40 am

Dropped Frames and New SDK

Post by avelazquez »

Hello,

I currently have an application tracking an object at 100fps, I understand utilizing the new SDK may resolve this issue however I already have an application and will like to salvage my code if possible. Is there a way to make the callback function FrameAvailable() be executed 200 times a second and have the camera tracking at 100fps; this should yield duplicates frame ID's which I can discard but might ensure no frames will be dropped.

Thanks!
beckdo
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Dropped Frames and New SDK

Post by beckdo »

So long as you're processing each FrameAvailable() callback in a quick and efficient manner, you should be receiving every frame that's made available from the camera side.

If you'd like to speed things up to 200FPS, the way to do that is change your arrangement to a polling scheme where you check for frames every 5ms (200FPS). The pseudo code is something like this:

Code: Select all

while(true)
{
  frame = camera->GetFrame();
  if(frame)
  {
    //== Process frame...
    frame->Release();
  }
  Sleep(5);
}
Post Reply