Unity sample for Camera2 API to capture image from CV/Main camera

As MLSDK being deprecated, we are trying to migrate MLCamera to Camera2/OpenXR APIs in our Unity application. We found support on Pixel Sensor only which does not support any RGB cameras, and we do not find any references for Unity to access Camera2 APIs to obtain the image, intrinsic, and extrinsic data. Will there be a sample on how we could retrieve such data with the new API?

Since Unity does not provide a direct way to access Android Camera APIs directly outside of the WebCamera Texture, we currently recommend that you continue using MLCamera functions.

Regarding the Pixel Sensor API, we are also investigating the possibility of allowing developers to obtain the camera frame using this API. Until then, the Pixel Sensor's Get Pose API can be used to obtain the RGB Camera pose inside the callback when an image is received (ie: RawVideoFrameAvailable in the following example)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.