Log in or register to post comments

How to detect live Object Using Vuforia(Unity 3d)

October 28, 2012 - 9:23pm #1

Hi All,

   I am newbie to Unity 3d with Vuforia.

     My question is :: Will it be possible to track live object ?

Example ::

         if i want to track a live Human hand movements, How i should do using Unity 3D Vuforia ?

Please guide me regarding this...

 

 Thank you in advance .....

 

How to detect live Object Using Vuforia(Unity 3d)

November 23, 2012 - 3:07am #12

Hi umesh

This is not supported directly, though it might be worth searching the forums to see if anyone has had any success here.

If you wanted to try something then it would be based around multi-targets, have a look at the developer guide -> trackables -> multitargets, and you can see how it is put together - but to be clear this is not easy and you may run into several issues here.

N

How to detect live Object Using Vuforia(Unity 3d)

November 23, 2012 - 2:46am #11

 

hi Nalin

i would like to know whether is it possible that we can detect or track 3d object (not cube only) a 3d object for example toy .or i can say use 3d object as a marker

 using Vuforia in unity 3d ..I'm waiting for reply.. thanks with regards

Umesh Sharma

How to detect live Object Using Vuforia(Unity 3d)

November 21, 2012 - 7:57pm #10

Thank you for your reply David,

 

    I will check it and if any problems means i will contact you again. 

Thank you,.......

 

  

 

How to detect live Object Using Vuforia(Unity 3d)

November 21, 2012 - 1:19pm #9

Use this technique ..

Adding content to a Trackable:

  • Request a DataSetTrackableBehaviour instance from the dataset:

DataSet.GetTrackable(int index);

  • Attach a TrackableEventHandler to its game object:

GameObject.AddComponent<MyTrackableEventHandler>(); You need to either write your own implementation of the ITrackableEventHandler interface or use theDefaultTrackableEventHandler that comes with the Vuforia AR Extension. TheTrackableEventHandler provides callbacks to handle Trackable lost and found events.

  • Add a child object for augmentation to the Trackable.

GameObject.transform.parent = DataSetTrackableBehaviour.transform;

// Add Trackable event handler and content (cubes) to the Trackables.

private void AttachContentToTrackables(DataSet dataSet)
{
    // Get the number of Trackables defined in the data set.
    
    int numTrackables = dataSet.GetNumTrackables();

    // Loop over all Trackables.
    
    for (int i = 0; i < numTrackables; ++i)
    {
        DataSetTrackableBehaviour dstb = dataSet.GetTrackable(i);
        GameObject go = dstb.gameObject;

        // Add a Trackable event handler to the Trackable. // This Behaviour handles Trackable lost/found callbacks.
        
        go.AddComponent<DefaultTrackableEventHandler>();

        // Create a cube object.
        
        GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);

        // Attach the cube to the Trackable and make sure it has a proper size.
        
        cube.transform.parent = dstb.transform;
        cube.transform.localScale = new Vector3(0.7f, 0.7f, 0.7f);
        cube.transform.localPosition = new Vector3(0.0f, 0.35f, 0.0f);
        cube.transform.localRotation = Quaternion.identity;
        cube.active = true;
        dstb.gameObject.active = true;
    }
}

How to detect live Object Using Vuforia(Unity 3d)

November 19, 2012 - 7:50pm #8

Thank you for Valuable reply,

  If i have a different Image targets in a single Dataset means How am i able to load image targets dynamically on a single Image Target prefab. ?

For Example :

 I have Img_targ_1 and Img_trg_2 in dataSet.

 Based on the direction I have to load either Img_trg_1 or Img_trg_2 dynamically ?

How we will be able to do this ?

 Thank you in advance ...

 

 

 

How to detect live Object Using Vuforia(Unity 3d)

November 9, 2012 - 4:44pm #7

For the behaviour that you're looking for, you would deactivate the current dataset and activate the next one in response to OnTrackingFound events defined within the DefaultTrackableEventHandler. To implement a pause before doing this, you can use

yield WaitForSeconds(5.0); 

http://docs.unity3d.com/Documentation/ScriptReference/index.Coroutines_26_Yield.html

Here's an example of how to toggle between two datasets..

Debug.Log("Toggle data set");
ImageTracker imageTracker = (ImageTracker)TrackerManager.Instance.GetTracker(Tracker.Type.IMAGE_TRACKER);

// Toggle between first two available data sets.
if (imageTracker.GetNumDataSets() >= 2)
{
DataSet activeDataSet = imageTracker.GetActiveDataSet();
if (activeDataSet == imageTracker.GetDataSet(0))
{
imageTracker.DeactivateDataSet(activeDataSet);
imageTracker.ActivateDataSet(imageTracker.GetDataSet(1));
Debug.Log("swapping to dataset " + imageTracker.GetDataSet(1).Path);
}
else
{
imageTracker.DeactivateDataSet(activeDataSet);
imageTracker.ActivateDataSet(imageTracker.GetDataSet(0));
Debug.Log("swapping to dataset " + imageTracker.GetDataSet(0).Path);
}
}
else
{
Debug.LogWarning("Not enough data sets to toggle");
}

You can do the same selectively based on the found mTrackableBehaviour.TrackableName.

How to detect live Object Using Vuforia(Unity 3d)

November 8, 2012 - 10:19pm #6

Thank you NalinS,

   I already studied that Swappable Dataset page. But i din't Understand anything from that.

 The points it covered in runtime changing on Dataset telling that

  1) Loading the DataSet

  2) Activating a dataset.

  3) Adding content to Trackable.

 4) Destroying a Dataset

 In all the points there is code, But i am not getting where to put.

 In DataSetLoadBehaviour script attached to the ARCamera there is only one Awake fuction to load the DataSet,

 But where i have to change the above points code for runtime loading of DataSets. ?

 

   Please guide me. I am newbie to Augmented reality.

Thank you in advance.....

 

 

 

 

 

 

 

 

 

How to detect live Object Using Vuforia(Unity 3d)

November 8, 2012 - 2:58am #5

The SDK documentation shows how to do this:

https://ar.qualcomm.at/sdk/android  (or iOS if you prefer)

Getting Started - Unity Extension

    >Step 3 Mastering Advanced Topics

          >Swappable Datasets

 

where it also shows the code to load and activate a dataset at run-time.

HTH

N

 

 

 

How to detect live Object Using Vuforia(Unity 3d)

November 7, 2012 - 10:08pm #4

Hi All,

 How to load two DataSets dynamically one after the other. I am using Unity3D with Vuforia ...

Example:

I want to track Image Target of one dataset and after tracking this display the 3D content and change the Dataset after some time and track the Image target of second dataset ..

How i should do this ?

 Please guide me in this.

   Advance thank you....

 

 

How to detect live Object Using Vuforia(Unity 3d)

October 29, 2012 - 5:35pm #3

What you can do is attach a suitable target to a 'live' object, in order to track it. There have been some examples of trackable clothing by developers on the forum. The thing to remember, is that the targets need to be flat and to contain sufficient detail and contrast to be detectable and trackable.

An organic shape, like the human hand doesn't meet these conditions. You'd need to apply a flat target image to the hand.  

If you're attempting to capture gestures visually, you should check out Qualcomm's FastCV SDK - https://developer.qualcomm.com/mobile-development/mobile-technologies/computer-vision-fastcv

How to detect live Object Using Vuforia(Unity 3d)

October 29, 2012 - 3:42am #2

Hi Ravilavs,

Sorry Vuforia does not support tracking of live objects or human hand movements.

HTH

N

Log in or register to post comments