iPhone Duo: continuous front-camera depth for measuring face distance

Hi, I’m building an app that counts push-ups with the phone on the floor. It currently uses ARKit and TrueDepth to measure the distance between the camera and the user’s face.

I want to support iPhone Duo too, but I don’t have one. I only have an iPhone 17 Pro.

I watched the camera presentation and saw that depth is supported when accessing the individual cameras. I’m trying to understand what that means for my app.

Can either front camera provide continuous depth through AVCaptureDepthDataOutput, or is it only available when taking photos?

Does it give actual distances in metres, or relative depth estimates? The face would usually be around 20 to 80 cm from the camera.

Also, is there an equivalent camera mode on my iPhone 17 Pro that I could use to test the same approach, or would I need an actual Duo?

It’s okay if counting is less accurate than with TrueDepth. I mainly need to detect the user moving down and back up reliably.

Thank you!

Hi, thanks for the detailed question!

ARKit only provides front depth on TrueDepth cameras. On iPhone Duo, the virtual front camera doesn't deliver depth, so unfortunately your current approach won't carry over.

You can try depth through AVFoundation, using one of the individual front cameras (builtInInnerUltraWideCamera or builtInOuterUltraWideCamera), as described in Build a great camera experience for iPhone Duo.

On iPhone Duo, this depth is relative, not absolute. You can check this with depthDataAccuracy on the AVDepthData you receive:

  • .absolute means the values are real distances in the physical world. TrueDepth gives you this.
  • .relative means the values are good for telling what's closer and what's farther (like foreground vs background), but they aren't real distances in metres.

This might be enough for your use case.