Hi!
I would like to obtain from VUFORIA ARCamera frame a texture2D.
I can do it on UnityEditor.
But, if I try it on Android, the method returns always an empty image.
How can I solve this?
The chosen pixelFormat is supported by the device.
Thank you all!
For Android and IPhone , C# script:-
if (CameraDevice.Instance.SetFrameFormat(Image.PIXEL_FORMAT.RGB888, true)) {
Debug.Log("Successfully registered pixel format " + mPixelFormat.ToString()); }
else {
Debug.LogError("\nFailed to register pixel format: " + mPixelFormat.ToString() + "\nThe format may be unsupported by your device." + "\nConsider using a different pixel format.\n");
return;
}
Image image = CameraDevice.Instance.GetCameraImage(Image.PIXEL_FORMAT.RGB888);
Try to do it in the next frame using Coroutine. Vuforia scripts examples works only in theory in clear proejects, not in real situation… So make slow and safe code
1 Like
He is right. I was receiving a null because I was calling CameraDevice.Instance.GetCameraImage in the firs Update frame.
Thank you mate