Name: Genius 2013-03-14 3:22
Appendix 1 – Detecting multiple markers with the AR Toolkit Plus
This is not to be mistaken for multi-markers, which is a different thing altogether, but allows more than 1 marker and position to be detected. This is necessary if AR applications use more than 1 marker because the AR Toolkit Plus: build 2.1.1 only returns 1 marker id and its position matrix.
The key idea is to get access to the low-level marker data by using the extra parameters in calc and making sure enough memory is allocated for all the markers with Init. You then process the marker data manually to extract out the markers.
In the code below, m_Tracker is of type ARToolKitPlus::TrackerSingleMarker. The stl list m_MarkerData collects data on each marker, including a flag to hide or show it. The updatematrix flag in the calc function is set to false to avoid re-computing it twice since this is done with calcOpenGLMatrixFromMarker.
Sample code:
// New general multiple marker tracker code. Avoids processing video frame multiple times
ARToolKitPlus::ARMarkerInfo *markerinfo;
int nummarkers;
// Do not calculate opengl matrix (set nUpdateMatrix to false) since it is done manually
m_Tracker->calc(data,-1,false,&markerinfo,&nummarkers);
int size = m_MarkerData.size();
for (int c = 0; c < size; c++) {
int k = -1;
for (int m = 0; m < nummarkers; m++) {
if (markerinfo[m].id == c) { if (k == -1)
k = m;
else if (markerinfo[k].cf < markerinfo[m].cf)
k = m;
}
}
if (k == -1) { // no marker found
m_MarkerData[c].m_Visible = false;
}
else { // marker found
m_MarkerData[c].m_Visible = true;
m_MarkerData[c].m_Confidence = markerinfo[k].cf;
ARFloat center[2] = {0.0f,0.0f};
ARFloat patttrans[3][4];
m_Tracker->calcOpenGLMatrixFromMarker(&markerinfo[k],center,m_MarkerData[c].
m_Width,(ARFloat *)m_MarkerData[c].m_ModelViewMat);
} // end markers
Appendix 2 – AR Toolkit Performance Benchmarks
(Source: http://www.hitl.washington.edu/artoolkit/documentation/benchmark.htm#comparison)
some value of measured accuracy of ARToolKit, jitter problems, CPU dependencies,etc... (from Kato or Billinghurst course notes).
Appendix 3 – Computation Time in relation to the angle at which markers are viewed
Appendix 4 – Project Settings for AR Toolkit in Windows Visual Studio 2003 .NET
1) Tools → Options → Projects → VC++ Directories
a) Select Include files and add the include directories (containing the header files) of:
i) AR Toolkit
ii) OpenVRML (should be in AR Toolkit directory)
iii) OpenVRML dependencies
If OpenAL sound is used as in “Solar System”,
iv)OpenAL
If AR Toolkit Plus is used
v) AR Toolkit Plus
b) Select Library files and add the lib directories (containing the library, .lib files) of:
i) AR Toolkit
ii) OpenVRML
iii)OpenVRML dependencies
If OpenAL sound is used:
iv) OpenAL
If AR Toolkit Plus is used:
v)AR Toolkit Plus – win32 folder
3) In addition to the above, it is also necessary to place the relevant DLL files in the same directory as the AR application executable. Any data files like camera parameters, vrml files and marker patterns must be placed according to how they are coded.
This is not to be mistaken for multi-markers, which is a different thing altogether, but allows more than 1 marker and position to be detected. This is necessary if AR applications use more than 1 marker because the AR Toolkit Plus: build 2.1.1 only returns 1 marker id and its position matrix.
The key idea is to get access to the low-level marker data by using the extra parameters in calc and making sure enough memory is allocated for all the markers with Init. You then process the marker data manually to extract out the markers.
In the code below, m_Tracker is of type ARToolKitPlus::TrackerSingleMarker. The stl list m_MarkerData collects data on each marker, including a flag to hide or show it. The updatematrix flag in the calc function is set to false to avoid re-computing it twice since this is done with calcOpenGLMatrixFromMarker.
Sample code:
// New general multiple marker tracker code. Avoids processing video frame multiple times
ARToolKitPlus::ARMarkerInfo *markerinfo;
int nummarkers;
// Do not calculate opengl matrix (set nUpdateMatrix to false) since it is done manually
m_Tracker->calc(data,-1,false,&markerinfo,&nummarkers);
int size = m_MarkerData.size();
for (int c = 0; c < size; c++) {
int k = -1;
for (int m = 0; m < nummarkers; m++) {
if (markerinfo[m].id == c) { if (k == -1)
k = m;
else if (markerinfo[k].cf < markerinfo[m].cf)
k = m;
}
}
if (k == -1) { // no marker found
m_MarkerData[c].m_Visible = false;
}
else { // marker found
m_MarkerData[c].m_Visible = true;
m_MarkerData[c].m_Confidence = markerinfo[k].cf;
ARFloat center[2] = {0.0f,0.0f};
ARFloat patttrans[3][4];
m_Tracker->calcOpenGLMatrixFromMarker(&markerinfo[k],center,m_MarkerData[c].
m_Width,(ARFloat *)m_MarkerData[c].m_ModelViewMat);
} // end markers
Appendix 2 – AR Toolkit Performance Benchmarks
(Source: http://www.hitl.washington.edu/artoolkit/documentation/benchmark.htm#comparison)
some value of measured accuracy of ARToolKit, jitter problems, CPU dependencies,etc... (from Kato or Billinghurst course notes).
Appendix 3 – Computation Time in relation to the angle at which markers are viewed
Appendix 4 – Project Settings for AR Toolkit in Windows Visual Studio 2003 .NET
1) Tools → Options → Projects → VC++ Directories
a) Select Include files and add the include directories (containing the header files) of:
i) AR Toolkit
ii) OpenVRML (should be in AR Toolkit directory)
iii) OpenVRML dependencies
If OpenAL sound is used as in “Solar System”,
iv)OpenAL
If AR Toolkit Plus is used
v) AR Toolkit Plus
b) Select Library files and add the lib directories (containing the library, .lib files) of:
i) AR Toolkit
ii) OpenVRML
iii)OpenVRML dependencies
If OpenAL sound is used:
iv) OpenAL
If AR Toolkit Plus is used:
v)AR Toolkit Plus – win32 folder
3) In addition to the above, it is also necessary to place the relevant DLL files in the same directory as the AR application executable. Any data files like camera parameters, vrml files and marker patterns must be placed according to how they are coded.