Log in or register to post comments

Randomly flipped object on Y Axis

April 18, 2015 - 2:11pm #1

Hello,

I have a 5 star marker (tried with many 5 star actually).

If I get the phone close to the marker the object is always positioned correctly, and then it maintains the right visualization moving it further from the camera.

But if the marker is away from the phone, a little bit in the dark, and the tracker gets detected anyway, sometimes the 3d objects is flipped, and even if I get close to the marker to get a better detection, it remains flipped (it's rendered correctly and moves correctly, just flipped).

I understand that bad lighting conditions may lead to this erroneous tracking, but given that with my app the top of the 3d object is always upand the bottom is always down (or changing the point of view: the ARCamera is never supposed to be upside down), is there a way to detect when a 3dobject is flipped, and not to track it?

Thanks

Randomly flipped object on Y Axis

July 31, 2017 - 7:38am #5

Had a similar issue, where local Y orientation of objects placed on top of flat image tracking target planes was fine in Unity, but was upside down when using the Hololens.

Setting WorldCenterMode = CAMERA in the VuforiaBehaviour script of the ARCamera fixed the issue, now the objects are consistently oriented everywhere.

Randomly flipped object on Y Axis

April 23, 2015 - 1:09am #4

Thanks, in the meantime I resolved with this, that seems to be working:

float zAngle = GlobalManager.Instance.arCamera.transform.rotation.eulerAngles.z;
bool topOrientation = false;
if ((zAngle >= 0 && zAngle < 90|| (zAngle >= 230 && zAngle < 360)) topOrientation = true;

zAngle >= 240 should be 270, but if the camera is ortogonal to the target, and moved even 1 degree over it, the object would be considered upside down.

Continuous autofocus is already on, thanks for the suggestion.

 

 

Randomly flipped object on Y Axis

April 22, 2015 - 1:09am #3

A pose can occasionally be estimated as upside-down when viewing the target from very oblique angles and at relatively high distance (low / bad lighting conditions can also influence the result, of course).

you can detect whether the target is upside down by transforming the local target Y axis from local to Camera reference frame and check whether its Y component is negative. In Unity you can do this by taking the gameObject.transform of the Trackable and the transform of the current Camera, and using the Unity Transform class API; 

you can then reset the Target pose by stopping the ObjectTracker and restarting it (I'd suggest to stop it in current frame, wait one frame , and then restart it);

the Tracker can be stopped with:

TrackerManager.Instance.GetTracker<ObjectTracker>().Stop();

and started with:

TrackerManager.Instance.GetTracker<ObjectTracker>().Start();

 

EDIT:

one thing to consider is also the use of continuous autofocus; in case you have not enabled it, this is something that can help getting more robust detection and tracking performance ( in general); you can enable it with this code:

void Start () {
  QCARAbstractBehaviour qcar = (QCARAbstractBehaviour)FindObjectOfType(typeof(QCARAbstractBehaviour));
  if (qcar) {
    qcar.RegisterQCARStartedCallback(OnVuforiaStarted);
  }
}
	
private void OnVuforiaStarted () {
  CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);	
}

 

Randomly flipped object on Y Axis

April 21, 2015 - 5:22pm #2

Could you post some video of the effect?

Log in or register to post comments