Log in or register to post comments

Alternative to extended tracking

July 27, 2016 - 8:59pm #1

I am looking for a solution to an issue I have with Image Markers and Extended tracking. I am working on an AR Viewer app (For Google Cardboard headset) and here is what I would like to have happen:

1. Sit at a desk looking at the desktop. The desktop has a printed image marker on it.

2. Start tracking for my image marker.

3. When the image marker has been found a 3d model is presented on the screen.

4.  After having successfully found the object in step 3 I would like for Vuforia to stop tracking the object since the marker will occasionally go in and out of the view depending on where on the table top you are looking currently. (Extended tracking is not working for me here...if the marker goes out of view then the Image Marker 3d model disappears. 

Is there a way to do step 4?

First I thought perhaps I could use MixedRealityController because when you go from AR to VR then the pose of the tracked target is available and now you can display a proxy that has the same pose. However, after reading the article https://developer.vuforia.com/library//articles/Solution/Using-the-MixedRealityController-in-Unity   I could see that the camera isn't enabled in VIEWER_VR.

I appreciate any help/tips that you guys might have.


Thanks,

 

Alternative to extended tracking

June 21, 2017 - 4:26am #10

DigitalHoward wrote:

If you're trying to keep the tracked object on screen after the marker has been found but you want to break the AR tracking connection to the marker you can reparent the object from the ImageTarget to your 3D scene and it should remain on screen.

I was using the following code to toggle between 'Go Freestyle' mode and normal AR marker behaviour.

 

void onFreestyleToggleChange(bool in_value)

{

  if (in_value)

  {

   _lockedPosition = portal.transform.localPosition;

   _lockedRotation = portal.transform.localRotation;

   _lockedScale = portal.transform.localScale;

   portal.transform.SetParent(_arPortalParent.transform.parent, true);

  } else

  {

   portal.transform.SetParent(_arPortalParent.transform, false);

   portal.transform.localPosition = _lockedPosition;

   portal.transform.localRotation = _lockedRotation;

   portal.transform.localScale = _lockedScale;

  }

}

 

You can see that in one case I'm saving the current position of the marker before setting its transform parent to the main scene (_arPortalParent.transform.parent) and keeping it in the same world space via the true parameter. 

Hi, I'm new to this, so can I know where to put this code.

Alternative to extended tracking

August 1, 2016 - 9:03pm #9

I was able to figure out that the MixedRealityController has a property, AutoStopCameraIfNotNeeded, that is set to true by default. I could set this property myself and the camera didn't stop. It also looks like the MeshRenderer on the BackgroundPlane gets disabled when you transition between AR and VR. That was also easy to override so now I could get the camera in VR mode. 

However, after thinking more about the functionality that I am looking for this was ultimately not the solution either. I am trying to overlay an image when the user is looking down at a table (while sitting down) and don't want this image to shift after the marker has been found. I went back to Extended Tracking and enabled Persistent Extended tracking...This didn't help much either. When the marker goes out of view then the ImageMarker's 3d model starts to wobble. After reading more about Extended tracking I found out that it uses the environment to figure out the 3d object's position if it can't see the marker. Well, a common use case in my application is that you look down closer at the table at a certain spot i.e. your head is closer to the table and hence the background changes quite drastically. So I guess the Extended tracking has nothing to hold on to and doesn't know how to calculate the proper positioning. 

 

Alternative to extended tracking

July 30, 2016 - 8:46am #8

The AR_VR sample the TransitionManager.Update method checks if video bg is enabled. Depending on the current mode it will always enable/disable it. They use the flag somehow to know when they are able to switch mode (because of the fade tranistion).

But this is just the case in the example. If you use your custom logic you can achieve enabling or disabling the bg as you like.

Alternative to extended tracking

July 29, 2016 - 11:12am #7

Based on your suggestion I tried to enable the VideoBackground by trying two things. 

 

1. Wrote a script that got hold of the VideoBackgroundManager component and called the EnableVideoBackground on every Update. No video was showing. 

2. I also tried to change the Enable Video Background setting in the GUI while running the AV-VR example project but was unable to check it to be enabled. I noticed that Vuforia turns off the camera when it goes into VR mode and there seems to be no (at least obvious) way of enabling the background video. Darn it...

Thanks for the suggestion though. 

Alternative to extended tracking

July 29, 2016 - 7:46am #6

I think you can just reference the VideoBackgroundManager script (of your ARCamera) and set "Enable video background" as you wish ;)

Alternative to extended tracking

July 28, 2016 - 6:41pm #5

You have restated what I am trying achieve correctly. The only thing I want to add to your step 4 is that I still want the background camera showing. 

Regarding Extended tracking: i would like for the 3D model to not disappear when the image target can't be seen. This is something I haven't been able to do. I have read other recent posts on the forum where they have the same problem. 

I will rerun the sample app to make sure but I think I saw the same behavior there. Is the Extended tracking suppose to handle the case when the image target completely goes away? I think I saw that in a demo video somewhere but I haven't been able to verify that myself.  I have been using the Stones Image marker

Thanks.

 

Alternative to extended tracking

July 28, 2016 - 12:30pm #4

Hello,

I'm a bit confused by your use case, so let me try and restate it to see if I'm correct:

  1. Utilizing MixedReality controller mode HANDHELD_AR, detect image/marker using back facing camera. Pose updates are returned by the Vuforia object tracker.
  2. Display 3D model on screen using pose data returned by Vuforia
  3. Switch MixedReality controller mode to HANDHELD_VR
  4. Continue to render 3D model in similar position, but now using pose returned by Vuforia device tracker

Is the above another way of describing what you're trying to achieve?

Additionally, I'm wondering about you challenges using Extended Tracking. Is it that the feature does not work for you at all? Or that it does not work well enough for your use cases in typical environments? If it is the former, I would urge you to try running the Vuforia ImageTargets sample, with Extended Tracking enabled, in the same environment to see if the issue is implementation or environment related.

Thanks.

 

Alternative to extended tracking

July 28, 2016 - 11:32am #3

Thanks for your reply. 

I will test out your solution but it looks like it is not quite what I was looking for. I want to stop the AR tracking when I find the target but I would still want the 3d object to act like it is in the environment. For instance if I look away from where it first was found I don't want to see it on the screen but I want it to work better then what Extended tracking can offer.

It is kind of the case where you are going from VIEWER_AR to VIEWER_VR  using the MixedRealityController but the camera is still on in the background. I don't seem to be able to use Extended tracking because it makes the 3d object go away even though you see a partial image tracker.

Alternative to extended tracking

July 28, 2016 - 8:15am #2

If you're trying to keep the tracked object on screen after the marker has been found but you want to break the AR tracking connection to the marker you can reparent the object from the ImageTarget to your 3D scene and it should remain on screen.

I was using the following code to toggle between 'Go Freestyle' mode and normal AR marker behaviour.

 

void onFreestyleToggleChange(bool in_value)
{
  if (in_value)
  {
   _lockedPosition = portal.transform.localPosition;
   _lockedRotation = portal.transform.localRotation;
   _lockedScale = portal.transform.localScale;

   portal.transform.SetParent(_arPortalParent.transform.parent, true);
  } else
  {
   portal.transform.SetParent(_arPortalParent.transform, false);
   portal.transform.localPosition = _lockedPosition;
   portal.transform.localRotation = _lockedRotation;
   portal.transform.localScale = _lockedScale;
  }
}

 

You can see that in one case I'm saving the current position of the marker before setting its transform parent to the main scene (_arPortalParent.transform.parent) and keeping it in the same world space via the true parameter. 

Log in or register to post comments