1
votes

How can I force device camera to use highest resolution for AR camera? I used Vuforia 6 and Unity 5, but when I publish my app and used on device that has 8mb camera sensor, camera view in app is very low resolution. I think it's 640X480, and it zoomed.

In Unity Vuforia configuration setting I set camera device mode on "MODE_OPTIMIZE_QUALITY" but it doesn't change on resolution. My device: Samsung Galaxy Note 12.

I used this script:

Screen.SetResolution(1920,1080,true);

and assign to ARCamera but it don't have change. It should work for any device.

How can I fix this?

2

2 Answers

0
votes

I do not think you can get a higher resolution, I've been struggling with this as well in the past. Looking at the Vuforia forums you will see answers from the support guys, such as: "The Vuforia SDK uses a camera resolution that is optimised for detection and tracking. At present there is no way to increase the photo resolution.", and also "there is no specific solution to this; on certain devices the camera preview resolution is limited to 640 x 480".

You can set the modes via the api, but this is only a suggestion to the Vuforia engine, as there is no guarantee of a particular resolution.

0
votes

You can configure autofocus when Vuforia initializes by adding the following code to a script that inherits from Monobehaviour. This registers a callback with the VuforiaBehaviour that will set a focus mode when the Vuforia process has started.

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

https://library.vuforia.com/content/vuforia-library/en/articles/Solution/Working-with-the-Camera.html