<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVDepthData",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVDepthData"
  },
  "title" : "AVDepthData"
}
-->

# AVDepthData

A container for per-pixel distance or disparity information captured by compatible camera devices.

```
class AVDepthData
```

## Overview

*Depth data* is a generic term for a map of per-pixel data containing depth-related information. A depth data object wraps a disparity or depth map and provides conversion methods, focus information, and camera calibration data to aid in using the map for rendering or computer vision tasks.

A depth map describes at each pixel the distance to an object, in meters.

A disparity map describes normalized shift values for use in comparing two images. The value for each pixel in the map is in units of 1/meters: (`pixelShift / (pixelFocalLength * baselineInMeters)`).

The capture pipeline generates disparity or depth maps from camera images containing nonrectilinear data. Camera lenses have small imperfections that cause small distortions in their resultant images compared to an ideal pinhole camera model, so [`AVDepthData`](/documentation/AVFoundation/AVDepthData) maps contain nonrectilinear (nondistortion-corrected) data as well. The maps’ values are warped to match the lens distortion characteristics present in the YUV image pixel buffers captured at the same time.

Because a depth data map is nonrectilinear, you can use an [`AVDepthData`](/documentation/AVFoundation/AVDepthData) map as a proxy for depth when rendering effects to its accompanying image, but not to correlate points in 3D space. To use depth data for computer vision tasks, use the data in the [`cameraCalibrationData`](/documentation/AVFoundation/AVDepthData/cameraCalibrationData) property to rectify the depth data.

There are two ways to capture depth data:

- The [`AVCaptureDepthDataOutput`](/documentation/AVFoundation/AVCaptureDepthDataOutput) class captures and delivers depth data in a stream (similar to how the [`AVCaptureVideoDataOutput`](/documentation/AVFoundation/AVCaptureVideoDataOutput) delivers video data).
- The [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) class delivers depth data as a property of an [`AVCapturePhoto`](/documentation/AVFoundation/AVCapturePhoto) object containing the captured image.

You can also create [`AVDepthData`](/documentation/AVFoundation/AVDepthData) objects using information obtained from image files with the <doc://com.apple.documentation/documentation/ImageIO> framework.

When editing images containing depth information, use the methods listed in Transforming and Processing to generate derivative [`AVDepthData`](/documentation/AVFoundation/AVDepthData) objects reflecting the edits that have been performed.

## Topics

### Creating depth data

[`init(fromDictionaryRepresentation:)`](/documentation/AVFoundation/AVDepthData/init(fromDictionaryRepresentation:))

Creates a depth data object from depth information such as that found in an image file.

[`dictionaryRepresentation(forAuxiliaryDataType:)`](/documentation/AVFoundation/AVDepthData/dictionaryRepresentation(forAuxiliaryDataType:))

Returns a dictionary representation of the depth data suitable for writing into an image file.

### Reading pixel depth information

[`depthDataMap`](/documentation/AVFoundation/AVDepthData/depthDataMap)

A pixel buffer containing the depth data’s per-pixel depth or disparity data map.

[`depthDataType`](/documentation/AVFoundation/AVDepthData/depthDataType)

The pixel format of the depth data map.

### Evaluating depth data

[`isDepthDataFiltered`](/documentation/AVFoundation/AVDepthData/isDepthDataFiltered)

A Boolean value indicating whether the depth map contains temporally smoothed data.

[`depthDataAccuracy`](/documentation/AVFoundation/AVDepthData/depthDataAccuracy)

The general accuracy of depth data map values.

[`AVDepthData.Accuracy`](/documentation/AVFoundation/AVDepthData/Accuracy)

Values indicating the general accuracy of a depth data map.

[`depthDataQuality`](/documentation/AVFoundation/AVDepthData/depthDataQuality)

The overall quality of the depth map.

[`AVDepthData.Quality`](/documentation/AVFoundation/AVDepthData/Quality)

Values indicating the overall quality of a depth data map.

### Transforming and processing

[`applyingExifOrientation(_:)`](/documentation/AVFoundation/AVDepthData/applyingExifOrientation(_:))

Returns a derivative depth data object by mirroring or rotating it to the specified orientation.

[`converting(toDepthDataType:)`](/documentation/AVFoundation/AVDepthData/converting(toDepthDataType:))

Returns a derivative depth data object by converting the depth data map to the specified data type.

[`availableDepthDataTypes`](/documentation/AVFoundation/AVDepthData/availableDepthDataTypes-3ifx1)

The list of depth data formats to which you can convert this depth data.

[`availableDepthDataTypes`](/documentation/AVFoundation/AVDepthData/availableDepthDataTypes-472g0)

The list of depth data formats to which you can convert this depth data.

[`replacingDepthDataMap(with:)`](/documentation/AVFoundation/AVDepthData/replacingDepthDataMap(with:))

Returns a derivative depth data object by replacing the depth data map.

### Using calibration data

[`cameraCalibrationData`](/documentation/AVFoundation/AVDepthData/cameraCalibrationData)

The imaging parameters with which this depth data was captured.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)