<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureDevice/extrinsicMatrix(from:to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureDevice(cm)extrinsicMatrixFromDevice:toDevice:"
  },
  "title" : "extrinsicMatrix(from:to:)"
}
-->

# extrinsicMatrix(from:to:)

Returns the relative extrinsic matrix from one capture device to another.

```
class func extrinsicMatrix(from fromDevice: AVCaptureDevice, to toDevice: AVCaptureDevice) -> Data?
```

## Parameters

`fromDevice`

The capture device that represents the source camera.

`toDevice`

The capture device that represents the destination camera.

## Return Value

A <doc://com.apple.documentation/documentation/Foundation/Data> containing a <doc://com.apple.documentation/documentation/simd/matrix_float4x3> matrix, which is a column major with 3 rows and 4 columns.

## Discussion

The extrinsic matrix consists of a unitless 3x3 rotation matrix (R) on the left and a translation (t) 3x1 column vector on the right, whose units are millimeters. The matrix expresses the destination camera’s extrinsics relative to the source camera. If `X_from` is a 3D point in the source camera’s coordinate system, you project it into the destination camera’s coordinate system with `X_to = [R | t] * X_from`.

Only physical cameras for which factory calibrations exist provide an extrinsic matrix. Virtual device cameras return `nil`.

> Important:
> If you enable video stabilization by setting a ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureConnection/preferredVideoStabilizationMode`` value, the pixels in stabilized video frames no longer match the relative extrinsic matrix from one device to another due to warping. Disable video stabilization if you’re using the extrinsic matrix and camera intrinsics.

---

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)