Log in or register to post comments

Is it possible User-Defined Target use old marker after close the app ?

August 26, 2016 - 8:14am #1

Is it possible when using user-defined target, and using the old marker without snapshot it again ?

Example : I snapshot picture A and using it as marker, and I closed the apps. When I open the apps again, I using picture A as marker without snapshot it. Is it possible ?

Is it possible User-Defined Target use old marker after close the app ?

September 6, 2016 - 3:34am #7

This feature has been requested since day 1, by every major party that uses or wanted to use UDT. Hasn't happened yet :(

Is it possible User-Defined Target use old marker after close the app ?

September 5, 2016 - 6:59pm #6

Where is the folder location that user-defined target save marker when test it in Unity ? 

Is it possible User-Defined Target use old marker after close the app ?

August 29, 2016 - 12:15pm #5

Hello,

This is entirely dependent upon the app's lifecycle as there is no way to store and persist UDT targets via the SDK. They reside in memory.

Thanks

Is it possible User-Defined Target use old marker after close the app ?

August 26, 2016 - 7:55pm #4

What I want to make is, if user restart the apps or the android, user still can use the old marker, is it possible ?

Is it possible User-Defined Target use old marker after close the app ?

August 26, 2016 - 7:51pm #3

How I can do that ?

this is my code for user-defined target

using UnityEngine;
using System.Collections;

using System.Collections.Generic;
using System.Linq;
using Vuforia;

public class ARUserMarker : MonoBehaviour , IUserDefinedTargetEventHandler  {

private UserDefinedTargetBuildingBehaviour mTargetBuildingBehaviour;
private ObjectTracker mImageTracker;
private DataSet mBuiltDataSet;

private bool mUdtInitialized = false;
private ImageTargetBuilder.FrameQuality mFrameQuality = ImageTargetBuilder.FrameQuality.FRAME_QUALITY_NONE;

public ImageTargetBehaviour ImageTargetTemplate;

public Texture iconMarker; //membuat tekstur icon capture marker

void Start() {
  mTargetBuildingBehaviour = GetComponent<UserDefinedTargetBuildingBehaviour>();
  if (mTargetBuildingBehaviour) {
   mTargetBuildingBehaviour.RegisterEventHandler(this);
  }
}

public void OnInitialized() {
  // look up the ImageTracker once and store a reference
  mImageTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();

  if (mImageTracker != null) {
   // create a new dataset
   mBuiltDataSet = mImageTracker.CreateDataSet();
   mImageTracker.ActivateDataSet(mBuiltDataSet);

   // remember that the component has been initialized
   mUdtInitialized = true;
  }
}

public void OnFrameQualityChanged(ImageTargetBuilder.FrameQuality frameQuality) {
  mFrameQuality = frameQuality;
}

public void OnNewTrackableSource(TrackableSource trackableSource) {
  // deactivates the dataset first
  mImageTracker.DeactivateDataSet(mBuiltDataSet);

  // Destroy the oldest target if the dataset is full
  if (mBuiltDataSet.HasReachedTrackableLimit()) {
   IEnumerable<Trackable> trackables = mBuiltDataSet.GetTrackables();
   Trackable oldest = null;
   foreach (Trackable trackable in trackables)
    if (oldest == null || trackable.ID < oldest.ID)
     oldest = trackable;

   if (oldest != null) {
    mBuiltDataSet.Destroy(oldest, true);
   }
  }

  // get predefined trackable (template) and instantiate it
  ImageTargetBehaviour imageTargetCopy = (ImageTargetBehaviour)Instantiate(ImageTargetTemplate);

  // add the trackable to the data set and activate it
  mBuiltDataSet.CreateTrackable(trackableSource, imageTargetCopy.gameObject);

  // Re-activate the dataset
  mImageTracker.ActivateDataSet(mBuiltDataSet);
}

void OnGUI() {
  if (!mUdtInitialized) return;

  // If Frame Quality is medium / high => show Button to build target
  if (mFrameQuality == ImageTargetBuilder.FrameQuality.FRAME_QUALITY_MEDIUM ||
      mFrameQuality == ImageTargetBuilder.FrameQuality.FRAME_QUALITY_LOW) {

   if (GUI.Button(new Rect(10,10,100,100), iconMarker)) { //membuat button capture marker
    BuildNewTarget(); //saat button ditekan, akan dibentuk target baru
   }
  }
}

private void BuildNewTarget() {
  string newTargetName = "MyUserDefinedTarget";
  mTargetBuildingBehaviour.BuildNewTarget(newTargetName, ImageTargetTemplate.GetSize().x);
}
}

 

Is it possible User-Defined Target use old marker after close the app ?

August 26, 2016 - 9:47am #2

Hello,

Yes, this is possible. The UDT feature 'remembers' the last 5 dynamic targets captured, storing the features in memory. If the app was closed but not killed, with the apps data still persisting in memory, then it could redetect them.

Thanks.

Log in or register to post comments