Log in or register to post comments

Disable Camera and Reenable doesn't work

September 13, 2017 - 1:59am #1

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.

Disable Camera and Reenable doesn't work

September 15, 2017 - 3:40am #2

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);

CameraDevice.Instance.Start();

 

 

Log in or register to post comments