"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

Disable Camera and Reenable doesn't work

Hi everyone,

I'm trying to disable Vuforia ARCamera on the Hololens to allow the device to take a picture and then, I'm re-enabling the camera with the code below :

Disable AR Camera : CameraDevice.Instance.Deinit(); CameraDevice.Instance.Stop();

Enable AR Camera : CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_BACK); CameraDevice.Instance.Start(); CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO); Debug.Log ("Camera should be working");

But Vuforia seems to be blocked at the line Camera.Device.Instance.Init() and the log below the line Camera.Instance.Init(...) is not displayed in the console.

I'm using Unity 5.6.1 and Vuforia SDK 6.2.10.

jaydcrowe1989

Fri, 09/15/2017 - 10:40

Try this. This is the solution that works for me.

 

Disable:

CameraDevice.Instance.Stop();

CameraDevice.Instance.Deinit();

 

Enable:

CameraDevice.Instance.Init(CameraDevice.CameraDirection.CAMERA_DEFAULT);