Dropped Frames
Posted: Wed Nov 10, 2010 3:51 pm
Hello All,
I am currently tracking a single object at 100fps. This seems simple enough, however accuracy is very important. I notice there were frames dropped. Any help getting to the bottom of this is greatly appreciated.
Below is the segment of code where the problem occurs (if there is a problem)
void CameraEvents::HandleFrameAvailable(INPCamera * pCamera)
{
camera->GetFrame(0, &NewFrame); //get the most recent frame
NewFrame->get_TimeStamp(&TimeStamp);
if(grayScale==true)
{ camera->DrawFrame(NewFrame, (long)tempHandle); } //tempHandle
NewFrame->get_Count(&lCount);
for (int i = 0; i spObject;
NewFrame->Item(i, &spObject);
long lRank;
spObject->get_Rank(&lRank);
if (lRank == 1)
{
if(grayScale==false)
{
//*************************crosshair***************************************
//*************************************************************************
//convert the x, y, area coordinate to string easy to handle
spObject->get_X(&varX);
//---------------------------------
spObject->get_Y(&varY);
//----------------------------------
spObject->get_Area(&varArea);
//------------------------------------
}
}
spObject.Release();
}
//if camera is stopped
NewFrame->Free();
NewFrame=NULL;
frame->Free();
frame=NULL;
}
Thank You!
I am currently tracking a single object at 100fps. This seems simple enough, however accuracy is very important. I notice there were frames dropped. Any help getting to the bottom of this is greatly appreciated.
Below is the segment of code where the problem occurs (if there is a problem)
void CameraEvents::HandleFrameAvailable(INPCamera * pCamera)
{
camera->GetFrame(0, &NewFrame); //get the most recent frame
NewFrame->get_TimeStamp(&TimeStamp);
if(grayScale==true)
{ camera->DrawFrame(NewFrame, (long)tempHandle); } //tempHandle
NewFrame->get_Count(&lCount);
for (int i = 0; i spObject;
NewFrame->Item(i, &spObject);
long lRank;
spObject->get_Rank(&lRank);
if (lRank == 1)
{
if(grayScale==false)
{
//*************************crosshair***************************************
//*************************************************************************
//convert the x, y, area coordinate to string easy to handle
spObject->get_X(&varX);
//---------------------------------
spObject->get_Y(&varY);
//----------------------------------
spObject->get_Area(&varArea);
//------------------------------------
}
}
spObject.Release();
}
//if camera is stopped
NewFrame->Free();
NewFrame=NULL;
frame->Free();
frame=NULL;
}
Thank You!