Log in or register to post comments

Camera Focus is not working

February 21, 2018 - 9:38am #1

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

 

Camera Focus is not working

July 24, 2018 - 4:12pm #17

Camera Focus is not working

July 24, 2018 - 2:10pm #16

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.

Camera Focus is not working

June 5, 2018 - 10:00am #15

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,

Vuforia Support

Camera Focus is not working

June 4, 2018 - 9:09am #14

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.

Something is going on there but it feels very different from the camera focus in previous versions of Vuforia. It looks like focus is only working on very high contrast images (e.g. black ink on white paper).

It fails to focus when i'm just pointing it into `the air` and try to focus something in front of me (e.g. a Polaroid picture on the table) or in the near distance (a picture on the wall).



I have tried:

FOCUS_MODE_CONTINUOUSAUTO and FOCUS_MODE_TRIGGERAUTO

Camera Focus is not working

May 31, 2018 - 10:55am #13

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

Camera Focus is not working

May 31, 2018 - 2:13am #12

Sadly the Vuforia Samples do not work for me.

 

Setup

 

 I get following error message when i try to run 3-ImageTargets scene:

 

Errors

Assets/SamplesResources/VuforiaSamplesUI/Scripts/SamplesAboutScreenInfo.cs(77,58): error CS1061: Type `Vuforia.VuforiaRuntime' does not contain a definition for `InitializationState' and no extension method `InitializationState' of type `Vuforia.VuforiaRuntime' could be found. Are you missing an assembly reference?

 

Update

It seems that i'm not the only one having this issue.

AttachmentSize
Image icon samples.png34.34 KB

Camera Focus is not working

May 31, 2018 - 12:20am #11

I will do that in the next days and report a screen capture as well.

Camera Focus is not working

May 30, 2018 - 10:46am #10

bedrocks wrote:

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

as well as

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

 

Both return true but seem to have no effect on the focus at all.

Can you test on the samples and see if autofocus is working there with this same setup? Could you share a recording of your experience if you are still encountering this issue?

Thanks,

Vuforia Support

Camera Focus is not working

May 30, 2018 - 4:02am #9

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

as well as

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

 

Both return true but seem to have no effect on the focus at all.

Camera Focus is not working

May 15, 2018 - 7:14am #8

Great news, thanks.

Camera Focus is not working

May 14, 2018 - 4:23pm #7

PuzzleFox wrote:

iPhone 7 Plus, iOS 11.2.1

Unity 2018.1.0f2

Autofocus does not work with ARKit 1.0, which is present in iOS 11.2. You'll need to update your device to have iOS 11.3 to take advantage of ARKit 1.5. You'll also need Vuforia 7.1.34 which is available with Unity 2018.1.

Thanks,

Vuforia Support

Camera Focus is not working

May 14, 2018 - 8:54am #6

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.

 

Using Vuforia 7.1.31 and also tried newer versions in Unity 2018.2 with no luck

Camera Focus is not working

May 10, 2018 - 2:42pm #5

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;

public class CameraFocusController: MonoBehaviour {

// code from  Vuforia Developer Library

// https://library.vuforia.com/articles/Solution/Camera-Focus-Modes

void Start() {   

  var vuforia = VuforiaARController.Instance;   

  vuforia.RegisterVuforiaStartedCallback(OnVuforiaStarted);   

  vuforia.RegisterOnPauseCallback(OnPaused);

private void OnVuforiaStarted() {   

  CameraDevice.Instance.SetFocusMode(

   CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

}

private void OnPaused(bool paused) {   

  if (!paused) // resumed

  {

   // Set again autofocus mode when app is resumed

   CameraDevice.Instance.SetFocusMode(

    CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);   

  }

}

}

 

 

 

Camera Focus is not working

May 9, 2018 - 4:31pm #4

Hello PuzzleFox,

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

Thanks,

Vuforia Support

Camera Focus is not working

May 9, 2018 - 3:07pm #3

Same for me too. Unity 2018.1 - autofocus reports success but doesn't work on device. Apps built with old versions of Vuforia work perfectly. 

I'm trying to track small 2x3 inch images, which is impossible with the latest Vuforia. Haven't found any way to update Vuforia outside of Unity itself.

Is there a timeline for this to be fixed?

Camera Focus is not working

February 28, 2018 - 12:50am #2

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.

 

Log in or register to post comments