---
title: VNGenerateOpticalFlowRequest
framework: vision
role: symbol
role_heading: Class
path: vision/vngenerateopticalflowrequest
---

# VNGenerateOpticalFlowRequest

An object that generates directional change vectors for each pixel in the targeted image.

## Declaration

```swift
class VNGenerateOpticalFlowRequest
```

## Overview

Overview This request operates at a pixel level, so both images need to have the same dimensions to successfully perform the analysis. Setting a region of interest limits the region in which the analysis occurs. However, the system reports the resulting observation at full resolution. Optical flow requests are resource-intensive, so create only one request at a time, and release it immediately after generating optical flows.

## Topics

### Configuring the Request

- [computationAccuracy](vision/vngenerateopticalflowrequest/computationaccuracy-swift.property.md)
- [VNGenerateOpticalFlowRequest.ComputationAccuracy](vision/vngenerateopticalflowrequest/computationaccuracy-swift.enum.md)
- [outputPixelFormat](vision/vngenerateopticalflowrequest/outputpixelformat.md)
- [keepNetworkOutput](vision/vngenerateopticalflowrequest/keepnetworkoutput.md)

### Accessing the Results

- [results](vision/vngenerateopticalflowrequest/results.md)

### Identifying Request Revisions

- [VNGenerateOpticalFlowRequestRevision2](vision/vngenerateopticalflowrequestrevision2.md)
- [VNGenerateOpticalFlowRequestRevision1](vision/vngenerateopticalflowrequestrevision1.md)

## Relationships

### Inherits From

- [VNTargetedImageRequest](vision/vntargetedimagerequest.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Optical flow

- [VNTrackOpticalFlowRequest](vision/vntrackopticalflowrequest.md)
