another developer finished it before me! look into the GEM source code and you’ll find an ArtToolKit external..
the development of my version is no longer active, I’ll keep the page up just for some time...
our goal is to build an external for pd embedding artoolkitplus and taking gem images as input and giving markers positions as output
using the new version of ARToolKitPlus which is both for windows and for linux (and osx too?)
| status | linux | windows | osx |
|---|---|---|---|
| dummy: simply having a working source skeleton and makefiles | OK | NO | NO |
| using Gem images | ![]() | NO | NO |
| detecting markers | NO | NO | NO |
| tracking markers (single marker) | NO | NO | NO |
| tracking markers (multiple markers) | NO | NO | NO |
| usable output | NO | NO | NO |
| documentation | NO | NO | NO |
old version, i’m not working on it anymore
problem: the lack of working examples stopped me, i pass it an image but markers are not recognized..
new source (from dirk reiners):
msvc project
preliminar versions:
testing win32 binary, useful to see what it does at the moment: ar_single-testing-win32-bin.zip
at the current stage it should detect markers but it doesnt
it may be caused by:
the problem is that markers are found but not recognized (their id is always -1)
so image format is correct.
serious problem: is artoolkitplus cross-platform??
dmotd messed around with the new artk+ sources on gnu/linux..
the results seem healthy at this stage:
so cross platform support is looking very promising, i can only guess that it will run the same on an OSX machine. i’ll create and post a quick makefile asap, as well as the related binaries..
in the meantime, here’s my compile log (replace ‘/path/to’ to the actual location of the files)
for ARToolKitPlus in /path/to/ARToolKitPlus/src:
g++ -shared -fPIC -g -O2 -freg-struct-return -O3 -fno-builtin -falign-loops=16 -funroll-loops -ffast-math -mmmx -I/path/to/ARToolKitPlus/include *.cpp ld -export_dynamic -shared -o libARToolKitPlusD.so *.o -lc -lm cp libARToolKitPlusD.so /usr/lib ldconfig
for ar_single in /path/to/ar_single:
g++ --shared -fPIC -g -O2 -freg-struct-return -O3 -fno-builtin -falign-loops=16 -funroll-loops -ffast-math -mmmx -I/path/to/ARToolKitPlus/include -I./includes -lARToolKitPlusD /path/to/Gem/src/Base/CPPExtern.o *.cpp -o ar_single.pd_linux
FYI: this machine is a pentium3, running g++ (GCC) 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
i’ve made a msvc project starting from an old one (names are different). you’ll need to fix includs and lib paths to compile is.
i’ve called it ar_single. another will probably be ar_multi (and ar_memory, etc..)
→ in file src/TrackerSingleMarkerImpl.cxx
TrackerSingleMarkerImpl :: calc
arDetectMarker does not return -1 (no errors)
-1 is returned by the if at line 109 (no markers found)
but puttung a return marker_num; at line 88 i can see it returns the correct number of markers present in the image processed!!!
but putting a post(”found marker id %i”, marker_info[j].id); at line 92 (after the for) i see it finds only -1 markers.. what does this mean?? it finds markers but does not recognize them?
→ in file src/core/arDetectMarker.cxx
function arDetectMarker()
this function is where the id are assigned. it is very obscure, no comments. i have to figure out what’s wrong here...
if you comment out lines 111-117
/*
for( i = 0; i < wmarker_num; i++ ) {
if( wmarker_info[i].cf < 0.5 ) wmarker_info[i].id = -1;
}
*/
you’ll see the recognized tags..
ids don’t correspond but there is some logic.. if you rotate the image the recognized id changes.. i think the id is the evaluated sum of bits.. see http://studierstube.org/handheld_ar/images/artoolkit_id_marker.gif.
if we implement a logger ( logger api ) we can even read its messages...
anyway the main job is done here: tracker calc definition and doesn’t look difficult to translate gem’s image into RGBX
once we are able to pass an image to artoolkitplus we need to be able to use its output: we need to plan a good external architecture. solutions:
looking at GEM source GemPixUtil.h line2 62-65 i’d say gem is RGBA on win32 and linux (on osx is ARGB), bytes are in this order:
now i need to find out what ARToolKitPlus::PIXEL_FORMAT_RGBA is: