How to use Barcodes and track multiple at one time

Duchain
Posts: 8
Joined: Thu Mar 09, 2017 6:00 am

How to use Barcodes and track multiple at one time

Postby Duchain » Thu Mar 09, 2017 6:15 am

Hi all!

I am trying to use Barcodes but can't figure out how to uses them properly. I need to track two in my project simultaneously. I have been trying to use the barcodes in "doc/patterns/Matrix code 3x3 with Hamming (6,3) code (72dpi)".

In simplelite, I have added these two lines to the setupMarker Method and commented out everything else in that method:

Code: Select all

arSetPatternDetectionMode(arhandle, AR_MATRIX_CODE_DETECTION);
arSetMatrixCodeType(arhandle, AR_MATRIX_CODE_3x3_HAMMING63);


Image


I had used mk_patt to do marker training but as far as I am aware you do not need to do this for the supplied barcodes?

This tutorial post does not help very much:
https://artoolkit.org/documentation/doku.php?id=3_Marker_Training:marker_barcode

I have found this topic that seems to have the answer:
http://artoolkit.org/community/forums/viewtopic.php?f=22&t=24755&p=30483&hilit=barcode#p30483

but I don't understand what they mean by

"and edit my marker file and replace the datt path names with code indexes."

Can someone give me a bit of generic sample code for that part to explain?
What I'm I supposed to store in "patt_name[] =" for barcodes?

Thanks for any help!

Duchain
Posts: 8
Joined: Thu Mar 09, 2017 6:00 am

Re: How to use Barcodes and track multiple at one time

Postby Duchain » Thu Mar 09, 2017 3:37 pm

So I've now figured it out.

In main method , swap the call to setupMarker completely with the lines :

arSetPatternDetectionMode(arhandle, AR_MATRIX_CODE_DETECTION);
arSetMatrixCodeType(arhandle, AR_MATRIX_CODE_3x3_HAMMING63);

patt_name can be removed, no marker training required.

the code in mainLoop then needs to be modified to detect more than one marker at a time (which I'm currently working on). These default barcode markers already have predefined ids.

MrDaniel
Posts: 381
Joined: Wed Nov 18, 2015 9:07 pm

Re: How to use Barcodes and track multiple at one time

Postby MrDaniel » Sun Mar 12, 2017 12:34 pm

Good work!


Return to “ARToolKit for Desktop v5.x”

Who is online

Users browsing this forum: No registered users and 2 guests