The problem seems to be due to a bug in Unity’s WebCamTexture API.
[RELEASED] OpenCV for Unity page-33#post-3445178
Android Native Camera Low Light/Low ISO - Questions & Answers - Unity Discussions
I actually tried the simple code (without OpenCV) using WebCamTexture but found that some models (google pixel) had the same problem.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WebcamTextureLowLightIssueOnAndroid : MonoBehaviour
{
WebCamTexture webCamTexture;
// Use this for initialization
void Start()
{
var devices = WebCamTexture.devices;
for (int cameraIndex = 0; cameraIndex < devices.Length; cameraIndex++)
{
// get front camera.
if (WebCamTexture.devices[cameraIndex].isFrontFacing == true)
{
var webCamDevice = devices[cameraIndex];
webCamTexture = new WebCamTexture(webCamDevice.name, 640, 480, 30);
break;
}
}
webCamTexture.Play();
gameObject.GetComponent<Renderer>().material.mainTexture = webCamTexture;
}
void OnDisable()
{
if (webCamTexture != null)
{
webCamTexture.Stop();
Destroy(webCamTexture);
webCamTexture = null;
}
}
}
And I reported the bug a few months ago using Unity Editor’s Bug Reporter and exchanged several times with Unity developers, but unfortunately, the report seems to have been closed now, without being able to reproduce the problem in the Unity-side verification environment.
To my knowledge, this problem remains unfixed.
To fix the problem, many people need to file a bug report.
Could you report bugs to Unity as well?