6dof with camera sdk
Posted: Mon Nov 15, 2010 9:27 am
hello friends!!
I'm using Camera SDK to calculate 6 DOF of vector clip object.
I put this code:
------------------------------------------------
Frame *frame0 = camera0->GetFrame();
if(frame0)
{
//== Ok, we've received a new frame, lets do something
//== with it.
// frame0->Rasterize(framebuffer);
//printf("\n\n BeginFrame \n");
vec->BeginFrame();
for(int i=0; iObjectCount(); i++)
{
cObject *obj = frame0->Object(i);
obj->
float x = obj->X();
float y = obj->Y();
printf("\n\n x %.3f , y %.3f, z %.3f ", x,y);
Core::Predistort2DPoint(lensDistortion,x,y);
vec->PushMarkerData(x, y, obj->Area(), obj->Width(), obj->Height());
}
//printf("\n\n Calculate \n");
vec->Calculate();
//printf("\n\n PushData \n");
vecprocessor->PushData(vec);
//printf("\n\n GetPosition \n");
vecprocessor->GetPosition(xp,yp,zp);
//printf("\n\n GetOrientation \n");
vecprocessor->GetOrientation(yaw,pitch,roll);
printf("\n\n x %.3f , y %.3f , z %.3f ", xp,yp,zp);
printf("\n\n pitch %.3f , yaw %.3f , roll %.3f ", pitch,yaw,roll);
-----------------------------------------------------------
But this doesn't work, values of xp, yp and zp are 1.#QO and pitch yaw and roll have the same values.
What's wrong?
I'm using Camera SDK to calculate 6 DOF of vector clip object.
I put this code:
------------------------------------------------
Frame *frame0 = camera0->GetFrame();
if(frame0)
{
//== Ok, we've received a new frame, lets do something
//== with it.
// frame0->Rasterize(framebuffer);
//printf("\n\n BeginFrame \n");
vec->BeginFrame();
for(int i=0; iObjectCount(); i++)
{
cObject *obj = frame0->Object(i);
obj->
float x = obj->X();
float y = obj->Y();
printf("\n\n x %.3f , y %.3f, z %.3f ", x,y);
Core::Predistort2DPoint(lensDistortion,x,y);
vec->PushMarkerData(x, y, obj->Area(), obj->Width(), obj->Height());
}
//printf("\n\n Calculate \n");
vec->Calculate();
//printf("\n\n PushData \n");
vecprocessor->PushData(vec);
//printf("\n\n GetPosition \n");
vecprocessor->GetPosition(xp,yp,zp);
//printf("\n\n GetOrientation \n");
vecprocessor->GetOrientation(yaw,pitch,roll);
printf("\n\n x %.3f , y %.3f , z %.3f ", xp,yp,zp);
printf("\n\n pitch %.3f , yaw %.3f , roll %.3f ", pitch,yaw,roll);
-----------------------------------------------------------
But this doesn't work, values of xp, yp and zp are 1.#QO and pitch yaw and roll have the same values.
What's wrong?