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

# VNTrackOpticalFlowRequest

An object that determines the direction change of vectors for each pixel from a previous to current image.

```
class VNTrackOpticalFlowRequest
```

## Overview

This request works at the pixel level, so both images must have the same dimensions to successfully perform the request.

Setting a region of interest isolates where to perform the change determination.

> Important:
> Optical flow requests are very resource intensive, so perform only one request at a time. Release memory immediately after generating an optical flow.

## Topics

### Creating an Optical Flow

[`init()`](/documentation/Vision/VNTrackOpticalFlowRequest/init())

Creates a new request that tracks the optical from one image to another.

[`init(completionHandler:)`](/documentation/Vision/VNTrackOpticalFlowRequest/init(completionHandler:))

Creates a new request that tracks the optical from one image to another, with a system callback on completion.

### Configuring the Request

[`computationAccuracy`](/documentation/Vision/VNTrackOpticalFlowRequest/computationAccuracy-swift.property)

The level of accuracy to compute the optical flow.

[`VNTrackOpticalFlowRequest.ComputationAccuracy`](/documentation/Vision/VNTrackOpticalFlowRequest/ComputationAccuracy-swift.enum)

Computational accuracy options.

[`keepNetworkOutput`](/documentation/Vision/VNTrackOpticalFlowRequest/keepNetworkOutput)

A Boolean value that indicates the raw pixel buffer continues to emit from the network.

[`outputPixelFormat`](/documentation/Vision/VNTrackOpticalFlowRequest/outputPixelFormat)

The pixel format type of the output value.

### Accessing the Results

[`results`](/documentation/Vision/VNTrackOpticalFlowRequest/results)

The optical flow results the request observes.



---

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)