Topic locked

How to retrieve a target's name. PLEASE HELP!

March 11, 2015 - 7:50pm #1

I'm trying to figure out how to retieve the name of a target, as per it's name in the Dataset, after it's been recognised by Vuforia. Please help as I can't seem to find any answer to this particular question.

Thanks

How to retrieve a target's name. PLEASE HELP!

March 12, 2015 - 12:45am #2

Are you looking for code on iOS native ?

If you look at the Vuforia Samples, you'll see that there is a method called "renderFrame" (for example, look at the ImageTargetsEAGLView.m file) in which the list of currently tracked targets is retrieved (there is a "for" loop which iterates over the TrackableResult list);

for each TrackableResult, you can obtain a Trackable (e.g. "result->getTrackable()") and for each Trackable instance you can query the Name:

const char *trackableName = trackable.getName();

Please see also our API reference, as this type of information is available there:

https://developer.vuforia.com/resources/api/ios/class_q_c_a_r_1_1_trackable_result

https://developer.vuforia.com/resources/api/ios/class_q_c_a_r_1_1_trackable

 

The same applies to Android, although in that case you'll probably want to use the JAVA API instead of the C++ one (although, there exist also a C++ API for Android, in case you're interested, see the ImageTargetsNative sample).

 

 

Topic locked