Grab the camera image/texture

I’m hoping this will be a relatively quick ask, I was able to capture the image feed from the camera using TryGetLatestImage when using the ‘old’ ARFoundation approach, so am just looking for the equivalent in via the MARS Api, no too worried if it works in the simulation in editor or not, I just need to be able to capture a texture from the camera once I detect a wall/plane.

Hello @Jon-at-Kaio_1 MARS leverages camera feed through AR Foundation so you should be good to go using the AR Foundation approach.

how do i get access to ARCameraManager via MARS ?

@Jon-at-Kaio_1 if you have a MonoBehaviour that implements IUsesCameraTexture you can call this.GetCameraTexture() (“this” is necessary because GetCameraTexture is an extension method for IUsesCameraTexture).

At runtime on device this will return the camera texture provided by AR Foundation. In simulation in the editor it will return the texture of the video in “Recorded” mode or the webcam in “Live” mode. In other simulation modes it returns null.

2 Likes

Awesome thank you.