"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

CloudReco stops after switching to Front Camera

Hi Guys,

I switch my camera with the attached script. But after switching, the Cloud Recognition stops working for new targets. Existing targets are still getting found...

Maybe anyone has an idea...

 

 public void ToggleCam()

    {
	        mIsScanning = false;

	        Vuforia.CameraDevice.Instance.Stop();

	        Vuforia.CameraDevice.Instance.Deinit();

	       

	        // turn on another camera

	        Vuforia.CameraDevice.Instance.Init(getNextCamera());

	        Vuforia.CameraDevice.Instance.Start();

	        mIsScanning = true;

	        if (Vuforia.CameraDevice.Instance.GetCameraDirection() != Vuforia.CameraDevice.CameraDirection.CAMERA_FRONT)

	        {

	            CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

	        }

	       

	    }

	

	    private Vuforia.CameraDevice.CameraDirection getNextCamera()

	    {

	        // decide which camera to turn on

	        switch (Vuforia.CameraDevice.Instance.GetCameraDirection())

	        {

	            case Vuforia.CameraDevice.CameraDirection.CAMERA_BACK:

	            case Vuforia.CameraDevice.CameraDirection.CAMERA_DEFAULT:

	            default:

	                return Vuforia.CameraDevice.CameraDirection.CAMERA_FRONT;

	            case Vuforia.CameraDevice.CameraDirection.CAMERA_FRONT:

	                return Vuforia.CameraDevice.CameraDirection.CAMERA_BACK;

	        }

	    }

Hello xfexx,

Unfortunately, using the front camera with Cloud reco isn't officially supported functionality and you may run into issues like the one you described here when using it. I apologize for the inconvenience.

Hello Strasza,

 

thanks for the reply! Do you think it is possible to work with device tracking instead?
I tried restart the tracker, but it made no difference. If it is possible with device tricking I will defenitely keep it in mind!

Thanks,

xfexx

In both cases I would recommend using regular Image Targets, which can support 1000+ targets.

Thanks,

-Vuforia Support