Search Unity

Question ARKit for Depth with Game Camera

Discussion in 'AR' started by ademord, Jun 17, 2021.

  1. ademord

    ademord

    Joined:
    Mar 22, 2021
    Posts:
    49
    Hello, I am new to this forums since i come from the MLAgents forums.

    I want to get depth information in unity and I found out I could use ARKit to obtain depth somehow. I made the assumption this works only with phones / iphones? If someone could help me validate that assumption?

    I need to use it with a game camera, so that I can feed my RL Agent the depth channel (or get depth and then obtain a point cloud).

    I am struggling to find tutorials and documentation, if someone could answer me if it is possible to use a game camera with ARKit and how to do it?

    Separately (non-ARKit), I have found docs on how to access a depth texture (which must be activated on a camera) but I dont know how to access it and save it to an image for example (or pass it to an ML model for real-time processing, for that matter), if someone could help me out?

    My end goal is to reward my agent based on how well he reconstructs a scene's 3D mesh. Has anyone ever worked with the XR mesh subsystem?
     
    Last edited: Jun 17, 2021
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,144
    The LiDAR scanner is required to generate the depth texture.
    https://developer.apple.com/documen...lysis/creating_a_fog_effect_using_scene_depth
    Unfortunately, there is currently no other way to receive the depth texture rather than via ARKit. Camera's depth texture is unrelated to the physical depth of the environtemnt.