---
title: "motion(of:comparedTo:flags:)"
framework: Video Toolbox
role: symbol
role_heading: Instance Method
platforms: [iOS 26.0+, iPadOS 26.0+, Mac Catalyst 26.0+, macOS 26.0+, tvOS 26.0+, visionOS 26.0+]
path: "videotoolbox/vtmotionestimationsession/motion(of:comparedto:flags:)"
---

# motion(of:comparedTo:flags:)

## Declaration

```swift
final func motion(of currentImage: CVReadOnlyPixelBuffer, comparedTo referenceImage: CVReadOnlyPixelBuffer, flags: VTMotionEstimationSession.FrameFlags = .init(rawValue:0)) async throws -> VTMotionEstimationSession.Motion
```

## See Also

### Estimating motion

- [VTMotionEstimationSession.FrameFlags](videotoolbox/vtmotionestimationsession/frameflags.md)
