An image analysis request that tracks movement of a previously identified rectangular object across multiple images or video frames.
Use this type of request to track the bounding boxes of rectangles throughout a sequence of images.
Vision returns locations for rectangles found in all orientations and sizes. The request returns the resulting rectangle
data in an instance of RectangleObservation.
- Parameters:
- detectedRectangle: The rectangle to track
- revision: The specific algorithm or implementation revision that's used to perform the request.
- frameAnalysisSpacing: The duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. By default all frames will be analyzed.
get · iOS 18.0+
descriptor
TypeScript
get descriptor(): RequestDescriptor
Swift declaration
final var descriptor: RequestDescriptor { get }
An enum that identifies the request and request revision.
get · iOS 18.0+
trackingLevel
TypeScript
get trackingLevel(): TrackRectangleRequest_TrackingLevel
Swift declaration
final var trackingLevel: TrackRectangleRequest.TrackingLevel { get set }
set · iOS 18.0+
trackingLevel
TypeScript
set trackingLevel(value: TrackRectangleRequest_TrackingLevel)
Swift declaration
final var trackingLevel: TrackRectangleRequest.TrackingLevel { get set }
get · iOS 18.0+
inputObservation
TypeScript
get inputObservation(): (SDKHandle) & (SDKHandle)
Swift declaration
final let inputObservation: any QuadrilateralProviding & VisionObservation
The object which will be tracked.
get · iOS 18.0+
regionOfInterest
TypeScript
get regionOfInterest(): NormalizedRect
Swift declaration
final var regionOfInterest: NormalizedRect { get set }
The region of the image in which Vision will perform the request.
The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner.
By default, the region of interest will be the full image.
set · iOS 18.0+
regionOfInterest
TypeScript
set regionOfInterest(value: NormalizedRect)
Swift declaration
final var regionOfInterest: NormalizedRect { get set }
The region of the image in which Vision will perform the request.
The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image's lower-left corner.
By default, the region of interest will be the full image.
final func setComputeDevice(_ computeDevice: MLComputeDevice?, for computeStage: ComputeStage)
Assigns a compute device for a compute stage.
If the parameter `computeDevice` is `nil`, the framework removes any explicit compute device assignment and allows the framework to select the device.
Configure any compute device for a given compute stage. When performing a request, the system makes a validity check. Use `supportedComputeStageDevices` to get valid compute devices for a request’s compute stages.
- Parameters:
- `computeDevice: `The compute device to assign to the compute stage.
- `computeStage: `The compute stage.
get · iOS 18.0+
supportedRevisions
TypeScript
static get supportedRevisions(): Array<TrackRectangleRequest_Revision>
Swift declaration
static let supportedRevisions: [TrackRectangleRequest.Revision]
get · iOS 18.0+
frameAnalysisSpacing
TypeScript
get frameAnalysisSpacing(): _CoreMedia_CMTime
Swift declaration
final let frameAnalysisSpacing: CMTime
The reciprocal of maximum rate at which buffers will be processed.
The request will not process buffers that fall within the `frameAnalysisSpacing` since the previously performed analysis.
The analysis is not done by wall time but by analysis of of the time stamps of the samplebuffers being processed.
get · iOS 18.0+
revision
TypeScript
get revision(): TrackRectangleRequest_Revision
Swift declaration
final let revision: TrackRectangleRequest.Revision