"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

Camera Focus is not working

Unity ver: 2017.3.0p4

Vuforia: 7.0.47

Xcode: 9.2

 

Hi,

I have been trying to make my Vuforia app camera to constantly focus. So i wrote a script and attached it to the ARCamera object. Here's the code: 

 

using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia;

public class CameraFocusController : MonoBehaviour {

// Use this for initialization void Start () {   VuforiaARController.Instance.RegisterVuforiaStartedCallback(OnVuforiaStarted);   VuforiaARController.Instance.RegisterOnPauseCallback(OnPaused);

}

private void OnVuforiaStarted() {   bool focusSet = CameraDevice.Instance.SetFocusMode(    CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);   Debug.Log ("Camera Focus is set: " + focusSet); }

private void OnPaused(bool paused) {   if (!paused) // resumed   {    // Set again autofocus mode when app is resumed    CameraDevice.Instance.SetFocusMode(     CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);   } } }

 

On the console, focus camera mode is set since focusSet returns TRUE. But the camera focus doesn't work on my iPhone SE. So here are the Xcode's console log when the app is running:

ERROR/AR(53553) 2018-02-22 12:29:46: CameraDevice::getCameraCalibration(): Failed to get camera calibration because the camera is not initialized. cameraDeviceStartCamera Vuforia.CameraDevice:SetFocusMode(FocusMode) CameraFocusController:OnVuforiaStarted() CameraFocusController:Start() Camera Focus is set: True CameraFocusController:OnVuforiaStarted() CameraFocusController:Start()

 

I tried other mode too but nothing seems to work and I'm lost on the reason why it's not working. 

 

Thanks,

An

 

Same problem. Camera on iOS can not recognize any marks due to lack of focus.

Unity: 2017.3.1p2
Vuforia: 7.0.47
Xcode: 9.2

Will the focus be fixed in unity 2018?

Thanks for answer.

 

Hello PuzzleFox,

Could you share which devices you are testing, their os version, and the code you are using?

Thanks,

Vuforia Support

Any updates on this, or timelines for a fix?

In the event that we need to roll back to a previous version of Unity and/or Vuforia, how does that work with the Vuforia 7 license fee? This is a pretty big showstopper.

 

PuzzleFox

Thu, 05/10/2018 - 21:42

iPhone 7 Plus, iOS 11.2.1

Unity 2018.1.0f2

I've tried this, as well as may other code attempts (perhaps this is outdated?):

 

using UnityEngine;
using System.Collections;
using Vuforia;

Setup

Unity 2018.2.0b4, XCode 9.3, Vuforia 7.1.34, iPhone 6s, iOS 11.3.0

Approach

I have tried both:

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

Strasza

Wed, 05/30/2018 - 17:46

In reply to by bedrocks

[quote=bedrocks]

Setup

Unity 2018.2.0b4, XCode 9.3, Vuforia 7.1.34, iPhone 6s, iOS 11.3.0

Approach

I have tried both:

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

Hi bedrocks,

Did you upgrade Vuforia from 7.1.31 to 7.1.34 in this version of Unity? If not, you can upgrade it through the Vuforia Configuration. This issue looks like a mismatch between the Vuforia version and the sample version.

Thanks,

Vuforia Support

I started again with a fresh Unity 2018.1.2.f1 install (including Vuforia SDK 7.1.34), updated to Vuforia SDK to 7.1.35 with the installer and deployed Vuforia Core Samples 7.1.34 on my iPhone 6s running iOS 11.4.0.

Hello bedrocks,

Since this version of Vuforia is utilizing ARKit, the method of focusing may have changed due to how Apple handles camera focus on their devices with this updated ARKit. Vuforia leverages the device's focus methods, which are defined by the manufacturer.

Thanks,

Auto-Focus not working here as well.

 

Using Unity 2018.20f2 with Vuforia 7.2.23 to compile the Vuforia Core Samples project unto an Android device.

Nothing custom, just imported the package from the Asset Store and compiled.

Hello,

See the following comment: https://developer.vuforia.com/forum/unity-extension-technical-discussion/camera-focus-mode-android-unity#comment-64791

Thanks,

Vuforia Engine Support