Log in or register to post comments

Load Dataset from path cause camera unstable

June 12, 2019 - 3:52am #1

Hello,

First of all, I apologize for my bad English.

I have made an AR app, want it load dataset from persistentDataPath. It looks good at first. dataset has been load, imagetargets has create. But if attach something to imagetargets, it will be enable,but nothing can display before camera, because ARcamera is flying around scene, and imagetargets not follow it.

Here is my code, someone can help me? Thanks!

 

//Load function

public void LoadRecog()

    {

DataSetHandle.LoadDataSetFromPath(Application.persistentDataPath+@"/Vuforia/basketball.xml");                

DataSetHandle.ConfigVideoTrackable("2", VideoPlane);

 

}

//DataSetHandle.cs

public static void LoadDataSetFromPath(string absolutePath)

    {

        ObjectTracker objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();

        if (!DataSet.Exists(absolutePath, VuforiaUnity.StorageType.STORAGE_ABSOLUTE))

        {

            Debug.Log("load dataset Exists null");

            return;

        }

        else

        {

            objectTracker.Stop();

            dataSet = objectTracker.CreateDataSet();

            if (dataSet.Load(absolutePath, VuforiaUnity.StorageType.STORAGE_ABSOLUTE))

            {

                objectTracker.ActivateDataSet(dataSet);

            }

            objectTracker.Start();

        }

    }

 

 

AttachmentSize
Image icon arcameraaroundworld.gif101.5 KB
Image icon lookslikegood.jpg32.66 KB

Load Dataset from path cause camera unstable

June 13, 2019 - 7:43am #4

Hello,

The next possibility is that the printed target's aspect ratio does not match the values specified in the device database. Always print the image that was uploaded to the portal to the exact same aspect ratio. Any stretching or altering of the image may cause tracking pose jitter. Some printers default to "stretch to fit", which can change the aspect ratio.

Thanks,

Vuforia Engine Support

Load Dataset from path cause camera unstable

June 12, 2019 - 8:49pm #3

Hello medabit,

Thanks for your advice, I have checked ARCamera's world center mode, set it to FIRST_TARGET will cause camera to fly, if set it to DEVICE or SPECIFC_TARGET, founded imagetarget will go to fly, all setttings are not as expected.

And I have use Unity 2018.3.11 and Vuforia 8.1.10, will this be reason? Also attach my VuforiaConfiguration for some advice.

Thanks for your help, looking forward to more suggestions!

AttachmentSize
Image icon VuforiaConfig.jpg57.92 KB

Load Dataset from path cause camera unstable

June 12, 2019 - 11:44am #2

Hello,

This behavior sounds like your world center mode being set to DEVICE, rather than FIRST_TARGET. Please check the following setting on your ARCamera game object: Vuforia Behaviour->World Center Mode.

Note: World Center Mode defines which object in the scene will serve as the origin ( 0,0,0 ) of the scene's world space:

  • SPECIFIC_TARGET allows you to select which target is used as the scene origin
  • FIRST_TARGET uses the first target detected as the scene origin
  • DEVICE uses the ARCamera as the scene origin

Thanks,

Vuforia Engine Support

Log in or register to post comments