Search Unity

Simultaneous face tracking and rear camera AR

Discussion in 'AR' started by edwon, Jul 12, 2019.

  1. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    I followed the example in the github examples project, but when I implement in the same way in my project, it switches to the face camera as soon as I start recording using NatCorder.

    The only difference in the scene is the presence of an ARFaceManager. If I disable that, it doesnt switch the face camera when recording.

    Any clues? I wish I could control which camera it shows in the ARCameraBackground better.
     
    ina likes this.
  2. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    AFAIK you can’t activate both cameras at the same time...
     
  3. edwon

    edwon

    Joined:
    Apr 24, 2011
    Posts:
    266
    Yes you can. With ARKit 3.0 and iOS13 with an iPhoneXR or XS or equivalent iPad, you can get facial tracking data from the front camera at the same time as using AR with the rear camera. It’s a new thing they just announced and Unity supports it. It’s mentioned in the ARFoundation docs somewhere.
     
  4. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    Last edited: Jul 23, 2019
  5. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    Yup
    https://github.com/Unity-Technologies/arfoundation-samples/tree/5.0
    Rear Camera (ARKit)
    iOS 13 adds support for face tracking while the world-facing (i.e., rear) camera is active. This means the user-facing (i.e., front) camera is used for face tracking, but the pass through video uses the world-facing camera. To enable this mode in ARFoundation, you must enable an ARFaceManager, set the ARSession tracking mode to "Position and Rotation" or "Don't Care", and set the ARCameraManager's facing direction to "World". Tap the screen to toggle between the user-facing and world-facing cameras.