---
title: "init(cmSampleBuffer:orientation:options:)"
framework: vision
role: symbol
role_heading: Initializer
path: "vision/vnimagerequesthandler/init(cmsamplebuffer:orientation:options:)-335k4"
---

# init(cmSampleBuffer:orientation:options:)

Creates a request handler that performs requests on an image of a specified orientation contained within a sample buffer.

## Declaration

```swift
init(cmSampleBuffer sampleBuffer: CMSampleBuffer, orientation: CGImagePropertyOrientation, options: [VNImageOption : Any] = [:])
```

## Parameters

- `sampleBuffer`: The sample buffer that contains the image to analyze. If the sample buffer doesn’t contain an image buffer with image data, the system raises an error.
- `orientation`: The EXIF orientation of the image.
- `options`: A dictionary that specifies auxiliary information about the image.

## Discussion

Discussion Sample buffers may contain metadata, like the camera intrinsics. Vision algorithms that support this metadata use it in their analysis, unless overwritten by the options you specify. important: Use a physical device to perform your testing. Performing requests in Simulator may produce inaccurate results due to the inability of Core Image to render certain pixel formats in this environment.

## See Also

### Creating a Request Handler

- [init(cgImage:options:)](vision/vnimagerequesthandler/init(cgimage:options:)-4qda6.md)
- [init(cgImage:orientation:options:)](vision/vnimagerequesthandler/init(cgimage:orientation:options:)-63ojm.md)
- [init(ciImage:options:)](vision/vnimagerequesthandler/init(ciimage:options:)-4wf33.md)
- [init(ciImage:orientation:options:)](vision/vnimagerequesthandler/init(ciimage:orientation:options:)-3svy6.md)
- [init(cvPixelBuffer:options:)](vision/vnimagerequesthandler/init(cvpixelbuffer:options:)-bkd7.md)
- [init(cvPixelBuffer:orientation:options:)](vision/vnimagerequesthandler/init(cvpixelbuffer:orientation:options:)-9fxug.md)
- [init(cvPixelBuffer:depthData:orientation:options:)](vision/vnimagerequesthandler/init(cvpixelbuffer:depthdata:orientation:options:)-3mj2d.md)
- [init(cmSampleBuffer:options:)](vision/vnimagerequesthandler/init(cmsamplebuffer:options:)-2yodn.md)
- [init(cmSampleBuffer:depthData:orientation:options:)](vision/vnimagerequesthandler/init(cmsamplebuffer:depthdata:orientation:options:)-8bjyh.md)
- [init(data:options:)](vision/vnimagerequesthandler/init(data:options:).md)
- [init(data:orientation:options:)](vision/vnimagerequesthandler/init(data:orientation:options:).md)
- [init(url:options:)](vision/vnimagerequesthandler/init(url:options:)-4k623.md)
- [init(url:orientation:options:)](vision/vnimagerequesthandler/init(url:orientation:options:)-70nta.md)
