iOS 16 has more noise in stream of raw depth values

I'm having an issue with depth values using iOS 16. I'm getting noisier depth data from my AVFCaptureSession on iOS 16 than iOS 15 and below. Has something changed for iOS 16?

I'm using the dual wide camera. My session initialization (minus some exception handling for when the session fails to initialize) looks like:

let depthDataOutput = AVCaptureDepthDataOutput()
let defaultVideoDevice: AVCaptureDevice? =
    AVCaptureDevice.default(
        .builtInDualWideCamera, 
        for: AVMediaType.video, position: .back
    )

let videoDeviceInput = AVCaptureDeviceInput(device: videoDevice)

session.beginConfiguration()
session.sessionPreset = AVCaptureSession.Preset.hd1920x1080
guard session.canAddInput(videoDeviceInput) else { return }

...

var depthFormat: AVCaptureDevice.Format?
if session.canAddOutput(depthDataOutput) {
    session.addOutput(depthDataOutput)
    depthDataOutput.alwaysDiscardsLateDepthData = true
    depthDataOutput.isFilteringEnabled = false
    guard let connection = depthDataOutput.connection(with: .depthData) else { return }
    connection.isEnabled = true

    // Search for highest resolution available (by width)
    depthFormat = videoDevice.activeFormat.supportedDepthDataFormats.filter({
        kCVPixelFormatType_DepthFloat32
        == CMFormatDescriptionGetMediaSubType($0.formatDescription)
    }).max(by: {
        fmt1, fmt2 in
        CMVideoFormatDescriptionGetDimensions(fmt1.formatDescription).width
          < CMVideoFormatDescriptionGetDimensions(fmt2.formatDescription).width
    })
}
...
session.commitConfiguration()
Post not yet marked as solved Up vote post of ivyas Down vote post of ivyas
781 views

Replies

Hello, may you please report this issue with Apple's Feedback Assistant so we can follow up?

You can learn about Feedback Assistant here: https://developer.apple.com/bug-reporting/.

Also if you can, please attach a sample app demonstrating the issue.

Thank you.