Accurately measuring distances in mm between markers

May 30, 2012 at 5:23 PM

Hi, I am trying to use Goblin XNA to measure distances between related corners on square AR markers.

At the moment my test consists of 4 markers in a square grid on a piece of paper. The distances I am getting are relatively accurate when the paper is facing the webcam directly, however accuracy seems to drop when the paper angle is changed. The distances measured always seem to be too high. 

I was wondering if there is something wrong with the camera model I am using to estimate the distance. The tracking seems to  work relatively well, the corners projected onto the screen using the pose transform match up with those in the webcam image. 

The steps I have taken so far:

1. Calibration from 50 images (I am using GML toolkit and manually creating the calib.xml in the format specified).

2. Obtain Pose transform matrix using ALVAR via GoblinXNA

3. Project into 3D space the marker corners:

//Corner model, edgeLength = 8mm
Vector3[] modelCorners = new Vector3[]
      new Vector3(-edgeLength/2,edgeLength/2,0),
      new Vector3(-edgeLength/2,-edgeLength/2,0),
      new Vector3(edgeLength/2,-edgeLength/2,0),
      new Vector3(edgeLength/2,edgeLength/2,0)

//i is the marker ID, j is the corner (0 to 3), markerMatrices stores Matrix transform obtained from ALVAR
marker3dProjected[i, j] = (Matrix.CreateTranslation(modelCorners[j]) * markerMatrices[i]).Translation;

4. Work out distance between corners:

//i = marker 1, m = marker 2, corner = cornerID (0 to 3)

Any tips on how to improve the accuracy of the measurements?

Also is there any way to obtain the error value for detection from ALVAR?