<!--
{
  "availability" : [
    "iOS: 11.3.0 -",
    "iPadOS: 11.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ARKit",
  "identifier" : "/documentation/ARKit/ARReferenceImage/init(_:orientation:physicalWidth:)-ir2z",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "ARKit"
    ],
    "preciseIdentifier" : "c:objc(cs)ARReferenceImage(im)initWithPixelBuffer:orientation:physicalWidth:"
  },
  "title" : "init(_:orientation:physicalWidth:)"
}
-->

# init(_:orientation:physicalWidth:)

Creates a new reference image from a Core Video pixel buffer.

```
init(_ pixelBuffer: CVPixelBuffer, orientation: CGImagePropertyOrientation, physicalWidth: CGFloat)
```

## Parameters

`pixelBuffer`

A Core Video pixel buffer containing the image data for the new image.

`orientation`

The intended display orientation for the image.

`physicalWidth`

The real-world width, in meters, of the image.

## Discussion

To accurately recognize the position and orientation of an image in the AR environment, ARKit must know the image’s physical size. When you call this initializer, ARKit uses the `physicalWidth` measurement and `orientation` you provide together with the aspect ratio of the image itself to calculate the physical height. Use the [`physicalSize`](/documentation/ARKit/ARReferenceImage/physicalSize) property of the created [`ARReferenceImage`](/documentation/ARKit/ARReferenceImage) object to retrieve these values.

> Important: ARKit preprocesses reference images before using them for image detection. To provide reference images bundled with your app, create AR reference image assets in your Xcode asset catalog, and use the ``doc://com.apple.arkit/documentation/ARKit/ARReferenceImage/referenceImages(inGroupNamed:bundle:)`` method to load them.

---

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)