Reducing 'jitter' or 'jumpiness' of your virtual objects using Vuforia

Are there ways to reduce the amount of movement or ‘jitter’ of your virtual objects when using Vuforia?

Even with a well lit default target (stones in this case), with a static camera and static target there is noticeable ‘jumpiness’ or jitter of my virtual objects in Unity.

I don’t know how it is now, but in previous versions of vuforia what I did was avoid using the prefab GameObject (the one with the jitter) to render the geometry, but using another GameObject which followed the Transform of the original GO, but with some interpolation.

To show or hide the geometry like the original did, replace or update DefaultTrackableEventHandler, with a custom Monobehaviour that implements ITrackableEventHandler (or the current equivalent that says “it’s tracking/it’s not tracking”)

Thanks! So in Vuforia there are 2 prefabs, one for the trackable image target and the other for the camera.
And you make your virtual object(GameObject) you want to render as a child of the ImageTarget Prefab.
I think it is this child GameObject you are referring to, which doesn’t need to be a prefab

That would be the child, yes. Although, rather than making a child of the ImageTarget, which would still move with jitter, I’d make it an independent GameObject which follows that ImageTarget with interpolation.

The interpolation would be something like:

myPosition = Mathf.SmoothStep(myPosition, imageTargetPosition, strength);

Which IIRC would have to be done for each component of the position’s Vector3. Strength would be a float, could be Time.deltaTime * some float to modulate the intensity.

Depending on the strength of the interpolation you would trade off between exact position and smoothness.

2 Likes

Thanks. Found a useful script but after trying not sure I like the results.

Object appears to float over image target. I think because it takes into account x,y,z but not rotation of trackable image

1 Like

Yes, it is a little floaty if it takes too long. Try adjusting the speed to be very fast, it’ll be less jittery than the original at least.

You can interpolate the rotation too. Quaternions in Unity have slerp, you can use it like this:

newObject.transform.rotation = Quaternion.Slerp(imageTarget.transform.rotation, newObject.transform.rotation, strength);

Thanks, have it working.

Great! Glad to be of help.

On my target device, Samsung TAB S2 I notice that my virtual object seems to drift towards the image target, giving the appearance that it is floating.
I’m wondering if another possible solution is to somehow lock its position to the image target the moment it becomes visible?

You can, although there will be drifting over time, and if the marker leaves the camera when you get back it won’t probably be in the same place.

If that happens you can either make it jump or interpolate again.

still facing floating thing can you please explain your answer with code.Thanks in advance

Sorry to resurrect an old thread but this is exactly what I am trying to solve. When I instantiate a new object instead of just parenting the 3D object to the target in the scene, it’s position/rotation is still parented somehow. It’s not parented in the hierarchy and I tried different options like instantiate in world space.

where i put the script?
in AR camera?

I actually didn’t end up implementing this. Instead, I tweaked my target image and rebuilt in vuforia. It still jitters at times but I’m convinced it has to do with a shine coming off of the wine bottle target.

Thanks for this, saved my day :slight_smile:

Thanks for this, saved my day. Thanks for starting this thread :slight_smile:

Alright so where to put this script ?