Log in or register to post comments

Getting the names of each trackable in imagetargets

July 27, 2011 - 6:23pm #1

Hi, I was trying out the ImageTargets sample and I was able to get the name of the trackable when it is tapped through the help of some guy's code from another thread here in the forum. But I am just wondering on how will I be able to distinguish one image from another when multiple images are simultaneously rendered into the camera frame? So far I was only able to get to know the name of only one image which is the most recent that has been overlaid.

These are the codes that I used to get the name of the active trackable:

QCAR::State state = QCAR::Renderer::getInstance().begin();
const char * name="";

for(int tIdx = 0; tIdx {
//get target object
const QCAR::Trackable* trackable = state.getActiveTrackable(tIdx);
name = trackable->getName();
}

return env->NewStringUTF(name);

Getting the names of each trackable in imagetargets

December 31, 2015 - 12:10pm #4

To get currently tracked Trackables in Unity:

IEnumerable<TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetActiveTrackableBehaviours();
foreach (TrackableBehaviour tb in tbs) {
  Debug.Log("TrackableName: " + tb.name);
}

To get all Trackables (tracked or not), use GetTrackableBehaviours() instead.

See the API docs for more info:

http://developer.vuforia.com/library/resources/api/unity/class_vuforia_1_1_state_manager

 

Getting the names of each trackable in imagetargets

December 24, 2015 - 4:49am #3

Hello All,

 

I am new to Vuforia. Please help me.

I am not able to get the second image name from the list of target images i loaded in the Vuforia.

Could you please help me to find the actual tracked target image name?

Thanks & Regards,

Pradeep

 

 

Re: Getting the names of each trackable in imagetargets

July 28, 2011 - 7:16am #2

getNumActiveTrackables() is going to give you the count of any targets (i.e. images) that are detected a/o being tracked.

getNumTrackables() will give you the count of all possible targets regardless of their status.

So your code is correct for accomplishing what you want. Keep in mind that getNumActiveTrackables() and getActiveTrackable() reflect the target's status, and not the rendering that may be performed onto that target. That is, the target status is independent of any rendering operations.

Log in or register to post comments