Log in or register to post comments

Disabling autofocus (preferably on iOS)

November 12, 2018 - 11:39am #1

Hey all, we're making an experience with relatively small markers (~3") and we want users to be able to get up close to them.  The problem is when users get close, the autofocus wigs out and continuously adjusts itself creating a somewhat jarring experience.

 

Preferably what I'd want is for the camera to be on auto-focus while the user is looking for the target, then lock focus as soon as they've found it, however it looks like the only two options for iOS are continuous auto-focus and "normal" (whatever that means).  Is there any way to disable auto-focus?

Disabling autofocus (preferably on iOS)

May 25, 2019 - 10:24am #10

It’s iPhone X. Sorry for the delay reply, I’ve been contemplating not using Vitoria and starting over entirely on my app. It is a drawing app that allows you to trace an image on your drawing pad using AR but the constant autofocus makes the image jump around constantly even if the phone is perfectly still. I mention this because it’s a vital issue to the use of my app and not just a detail. I know this isn’t a Vitoria issue but I’m desperately looking for a way to fix this before starting over. I’m down to handle this in XCode if possible. I’ve attempted everything to the best of my ability within Unity to make this happen but it sounds like it’s just not possible. I’m out of ideas.

Disabling autofocus (preferably on iOS)

April 29, 2019 - 10:57am #9

Hello @joeweitzel,

Which iOS device is demonstrating this behavior?

Please note that the functioning of focus modes on a device is solely based upon the OEM's implementation. Vuforia does not have its own implementation of focus algorithms, so our APIs call native OS APIs.

Thanks,

Vuforia Engine Support

Disabling autofocus (preferably on iOS)

April 27, 2019 - 1:19pm #8

So I've spent a lot of time getting nowhere with this. Maybe I'm missing the point here or Vuforia doesn't want iOS devices to disable autofocus.

I created this script and nothing changes i form of autofocus. It constantly autofocuses still:

 void Start()
    {
        VuforiaRuntimeUtilities.SetAllowedFusionProviders(FusionProviderType.VUFORIA_VISION_ONLY);
        CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_TRIGGERAUTO);
    }

The only difference I see is that it takes forever to finally load and display, around 10-15 seconds...

I also tried checking Vuforia: Delayed Installation, and I just get a blank screen.

In XCode I get this message:

Requested Focus mode FOCUS_MODE_TRIGGERAUTO.  Not supported on this device.

Not sure where to go from here. Thanks for your help

Disabling autofocus (preferably on iOS)

April 17, 2019 - 9:10am #7

Thanks! What a great answer!

Any chance you could point me to where to add my script? Planned to add it to the ARCamera but that's a guess, and write something like this:

VuforiaRuntimeUtilities.SetAllowedFusionProviders(FusionProviderType.VUFORIA_VISION_ONLY)

Am I close? Thanks again!

Disabling autofocus (preferably on iOS)

April 16, 2019 - 10:39am #6

Hello,

joeweitzel wrote:

Sorry, I have to be missing the point here. I've built and completed a Unity/Vuforia iOS App and it works perfectly with no issues. An now I have to rebuild it just to disable autofocus?

Vuforia Engine SDK does not have its own focus modes implementation. Thus, we rely upon the device OEM's implementation. Calls to Vuforia APIs are essentially calls to native OS APIs.

That being said, our experience with the ARKit camera's implementation of continuous auto focus does not perform the same as the iOS camera. It is slower and more prone to unnecessary triggering. Thus, if you disable ARKit as the platform CV provider (via Vuforia Engine APIs - below), it will revert to the legacy iOS camera and auto focus should perform more like you're familiar.

joeweitzel wrote:

Any info how to "set the Fusion provider" on my Unity project? Saw something about removing the ARCore package??

As previously mentioned, the Fusion article discusses this topic: https://library.vuforia.com/content/vuforia-library/en/articles/Training/vuforia-fusion-article.html (see Enforcement of specific provider section). This means that before Vuforia initializes, you would set the setAllowedFusionProviders() to FUSION_PROVIDER_VUFORIA_VISION_ONLY. This will essentially disable the platform CV provider (ARKit, ARCore) and revert to the legacy camera solution (and more robust camera focus controls). The tradeoff is that you will no longer benefit from robust positional device tracking using ARKit, ARCore.

Thanks,

Vuforia Engine Support

 

 

Disabling autofocus (preferably on iOS)

April 15, 2019 - 4:03pm #5

Sorry, I have to be missing the point here. I've built and completed a Unity/Vuforia iOS App and it works perfectly with no issues. An now I have to rebuild it just to disable autofocus?

Any info how to "set the Fusion provider" on my Unity project? Saw something about removing the ARCore package??

Disabling autofocus (preferably on iOS)

April 15, 2019 - 7:16am #4

Like the previous message says, you'll have to set the fusion provider yourself.  ARKit is the default provider if it is available.

Disabling autofocus (preferably on iOS)

April 14, 2019 - 11:46am #3

Hi, sorry to bring back an old thread, but I'm not able to disable autofocus (Vuforia 8.1.7, Unity 2018.3.12f1), I've attempted:

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

... on OnVuforiaStarted, and it still constantly autofocuses. when I need it to only focus when I tap on the camera preview where I'd like it to focus on.

I haven't switched any other cameras or ARKit, I'm just using whatever the defaults a new Unity/Vuforia Plane Finder iOS App uses.

Thanks!

Joe

Disabling autofocus (preferably on iOS)

November 12, 2018 - 4:54pm #2

Hello,

This should be possible as long as you're using the legacy iOS camera and not the ARKit camera. Use the Fusion Provider APIs to set Vuforia to use our legacy SLAM Extended Tracking, and Vuforia APIs to control the auto focus modes.

https://library.vuforia.com/content/vuforia-library/en/articles/Training/vuforia-fusion-article.html

Thanks,

Vuforia Engine Support

Log in or register to post comments