Reputation: 1
An android project that can read different markers(multiple) and provide different output(video) for each tracked marker.
What have we achieved so far: 1) We have used the example project provided in ARToolkit(ARMultiProj) for tracking of multiple marker, it tracks one marker only.
What we are left to achieve:
1) we are trying to implement the multiple marker tracking concept for playing different video on tracking of different markers using NFT.
2) I have used the ARMultiProj right out of the box from android studio example projects provided with ARToolkit 5.3.2 and thats where the ARMultiProj failed to detect multiple trackers, instead it tracked just one all the time.
In this case, its the cubes for 6 markers in the following;
Marker.dat
6
a.patt
40.0
1.0000 0.0000 0.0000 0.0000
0.0000 1.0000 0.0000 0.0000
0.0000 0.0000 1.0000 0.0000
b.patt
40.0
1.0000 0.0000 0.0000 100.0000
0.0000 1.0000 0.0000 0.0000
0.0000 0.0000 1.0000 0.0000
c.patt
40.0
1.0000 0.0000 0.0000 200.0000
0.0000 1.0000 0.0000 0.0000
0.0000 0.0000 1.0000 0.0000
d.patt
40.0
1.0000 0.0000 0.0000 0.0000
0.0000 1.0000 0.0000 -100.0000
0.0000 0.0000 1.0000 0.0000
f.patt
40.0
1.0000 0.0000 0.0000 100.0000
0.0000 1.0000 0.0000 -100.0000
0.0000 0.0000 1.0000 0.0000
g.patt
40.0
1.0000 0.0000 0.0000 200.0000
0.0000 1.0000 0.0000 -100.0000
0.0000 0.0000 1.0000 0.0000
For understanding and convenience, i have put below the specific log from the project.
Logs:
E/ARToolKit: marker config():multi;Data/multi/marker.dat
E/libARWrapper: ARController (native): [info]Added marker (UID=0), total markers loaded: 1.
E/libARWrapper: ARController (native): [info]Marker 0 now visible
E/libARWrapper: ARController (native): [info]Marker 0 no longer visible
As you can see above, the project is able to track and create the assets from assets/data/multi folder of the different patt files along with the camera_para.dat and marker.dat yet it doesnt track other markers.
Kindly provide me with some guidelines on what would be the possible implementation for achieving the above scenario with code snippets and exact changes in ARToolkit files(if required). Thanks in advance!
Regards & Thanks,
Ganeshan P
Upvotes: 0
Views: 1020
Reputation: 5780
From what I gathered you have a slight misconception of that example Project. It demonstrate the use of "Multimarkers". See this site for a short explanation on markers.
Look here for a overview of AR-Markers
Multimarker only display 1 object but only one of the markers need to be completly visible.
In your case you might be better off to grab ARNativeOSG or nftBookProj as base. Both examples have at least two example markers.
ARNativeOSG ist for the display of OSG Models on framemarkers but it is really easy to modify. Just look under assets/Data/marker.dat and assets/Data/objects.dat. These are both textfiles. Just put your markers in marker.dat and connect them in objects.dat.
If you insist on using NFT take a look at nftBookProj. It has almost the same makeup. Look under src/main/assets/Data for those files. They each contain examples how to use them. Be aware. Although ARToolkit supports NFT I don't find it as robust as the framemarkers.
Example NFT markers.dat
# Number of markers
1 // <--- Amount of markers. Important to change if you add more
# Entries for each marker. Format is:
#
# Name of pattern file (relative to this file)
# Marker type (SINGLE)
# Marker width in millimetres (floating point number)
# Optional tokens:
# FILTER [x] Enable pose estimate filtering for the preceding marker
# x (optional) specifies the cutoff frequency. Default
# value is AR_FILTER_TRANS_MAT_CUTOFF_FREQ_DEFAULT, which
# at time of writing, equals 5.0.
# A blank line
../DataNFT/pinball // <-- Position of marker relativ to this file
NFT // <-- Type
FILTER 15.0 // <-- Extra option. I think it reduce jittering
Example objects.dat:
2 // <-- amount of objects. Important to change
../OSG/axes.osg //position relativ to file
0.0 0.0 0.0 //Translation in regards to the marker
0.0 1.0 0.0 0.0 //Rotation in regards to the marker
40.0 40.0 40.0 //Zoom
MARKER 1 //This refers to the Position in marker.dat
LIGHTING 0 //Some added options. Actually no idea what this does
../OSG/p51d-jw-animated.osg
4.5 118.25 30.0
90.0 1.0 0.0 0.0
25.0 25.0 25.0
MARKER 1 //This object appears together with the first on on the same marker
I hope this is helpful.
Upvotes: 0