important new!

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...

goal

our goal is to build an external for pd embedding artoolkitplus and taking gem images as input and giving markers positions as output

using ARToolkitPlus v 2

using the new version of ARToolKitPlus which is both for windows and for linux (and osx too?)

status

status linux windows osx
dummy: simply having a working source skeleton and makefiles OK NO NO
using Gem images FIXME 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

files

  • dummy external. compiled on linux. ok loading raw images from HD but problems using gem images.. is image format different? it really should not! test-artoolkitplus.tar.gz

notes

  • linking problems on win: you must compile Profiler.cpp inside atkp together with the gem external (or maybe just link it?). that is hopefully where the problem occours
  • problems with Gem image format: as soon as i try to use gem images it stops recognizing...

using ARToolkitPlus v 1

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..

  • is the image format correct? (i’ve digged as i could and seems ok)
  • is the markers detection ok? (i can’t test it because of the lack of examples)
  • do i initialize the ar class correctly?

status (bugs: recognizing tags)

  1. compiled a dummy gem external with artoolkitplus code: OK
  2. using gem images as input: yes
  3. loading template markers: maybe
  4. detecting template markers: bug
  5. detecting id markers: bug
  6. detecting multiple markers: no (todo)
  7. decided a outlet policy: no (todo)
  8. implemented outputs: no (todo)
  9. external working: no (todo)

files

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

problems

at the current stage it should detect markers but it doesnt :-(

it may be caused by:

  • wrong image format
  • markers not loaded (but the function doesn’t return an error)
  • i can’t read artoolkitplus output correctly

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:

  • artoolkitplus lib compiled omitting the MemoryManagerMemMap part (will try with #ifdef _WIN32 later)
  • ar_single compiles and links successfully
  • ar_single lib and object loads (we should have an output msg to confirm this)
  • tested the debug patch, which works but returns the usual ‘found Marker -1’

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)

notes

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..)

following image path

→ 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.

old notes

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:

  • one outlet for each tag (you need to declare how many tags you’ll use). (what a mess if we use many tags!)
  • a single outlet outputs a list with a tag identifier at the beginning, a route will do the job
  • ??

image format: RGBA

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:

  1. red (1 byte)
  2. green (1 byte)
  3. blue (1 byte)
  4. alpha (1 byte)

now i need to find out what ARToolKitPlus::PIXEL_FORMAT_RGBA is:

  • how many bytes does each color have?
  • which order?

links

 
AR\artoolkitplus.txt · Last modified: 2010/02/16 19:08
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki