Log in or register to post comments

CloudReco stops after switching to Front Camera

August 12, 2017 - 5:30am #1

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;

	        }

	    }

CloudReco stops after switching to Front Camera

August 17, 2017 - 8:41am #4

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

Thanks,

-Vuforia Support

CloudReco stops after switching to Front Camera

August 16, 2017 - 4:30pm #3

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

CloudReco stops after switching to Front Camera

August 15, 2017 - 11:24am #2

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.

Something to note about the code sample you provided, we also restart the tracker in our sample apps when switching the camera. You can see how this is done in CameraSettings.cs' RestartCamera function.

Thanks,

-Vuforia Support

Log in or register to post comments