Software Archive
Read-only legacy content
17061 Discussions

Object Tracking, coordinate system and units

Wen_L_
Beginner
367 Views

Hi,

I'm using the sample code for object tracking (2D and feature-based 3D) and would like more clarification on the units and coordinate system of the translation (obtained using PXCTracker::TrackingValues arrData->translation, display function from main is copied below with the translation values in bold and italicized). Documentation seem to indicate that the coordinate system is at the object origin and I assumed units are 'mm'. However, this does not seem to correlated when moving the camera around with the object static (z values range well above 1000 when in a 200-500mm workspace). Can someone also explain the depthnum value below. Is this code modified much from metaio? Are there references for noise and accuracy using these implementations for object tracking?

Thanks,

Wen

void DrawTrackingValues(HWND hwndDlg, PXCTracker::TrackingValues *arrData)
{
 ...
  const double pi = 3.1415926535897;
  const double depthnum = -630; // for the middleware being a left hand coordinate system.

  //correction values for translation and movement dependent on z values
  float depthcorrectionfactor = (arrData->translation.z/depthnum);
  arrData->translation.x = arrData->translation.x/depthcorrectionfactor;
  arrData->translation.y = arrData->translation.y/depthcorrectionfactor;

  PXCPoint3DF32 translation = arrData->translation;

  float xp = translation.x;
  float yp = translation.y;
  float zp = translation.z;

...

}

0 Kudos
1 Reply
Sebastian_A_1
Beginner
367 Views

Sorry to necro this question but did you ever find a conversion logic? I'm facing the same issue with the latest SDK 2D Tracking sample and an F200.

Thanks in advance

0 Kudos
Reply