vision

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package vision provides Go bindings for the Vision framework.

Apply computer vision algorithms to perform a variety of tasks on input images and videos.

The Vision framework combines machine learning technologies and Swift’s concurrency features to perform computer vision tasks in your app. Use the Vision framework to analyze images for a variety of purposes:

Text and document analysis

  • Locating and displaying recognized text: Perform text recognition on a photo using the Vision framework’s text-recognition request.
  • Recognizing tables within a document: Scan a document that contains a table and extract its content in a formatted way.
  • DetectBarcodesRequest: A request that detects barcodes in an image. ([BarcodeObservation], [BarcodeSymbology])
  • DetectDocumentSegmentationRequest: A request that detects rectangular regions that contain text in the input image.
  • DetectTextRectanglesRequest: An image-analysis request that finds regions of visible text in an image. ([TextObservation])
  • RecognizeDocumentsRequest: An image-analysis request to scan an image of a document and provide information about its structure.
  • RecognizeTextRequest: An image-analysis request that recognizes text in an image. ([RecognizedTextObservation])

Facial analysis

  • Analyzing a selfie and visualizing its content: Calculate face-capture quality and visualize facial features for a collection of images using the Vision framework.
  • DetectFaceCaptureQualityRequest: A request that produces a floating-point number that represents the capture quality of a face in a photo. ([FaceObservation])
  • DetectFaceLandmarksRequest: An image-analysis request that finds facial features like eyes and mouth in an image. ([FaceObservation])
  • DetectFaceRectanglesRequest: A request that finds faces within an image. ([FaceObservation])

Image segmentation and subject lifting

  • GenerateForegroundInstanceMaskRequest: A request that generates an instance mask of noticeable objects to separate from the background. ([InstanceMaskObservation])
  • GeneratePersonInstanceMaskRequest: A request that produces a mask of individual people it finds in the input image. ([InstanceMaskObservation])
  • GeneratePersonSegmentationRequest: A request that produces a matte image for a person it finds in the input image. ([PixelBufferObservation])

Pose analysis

  • DetectAnimalBodyPoseRequest: A request that detects an animal body pose. ([AnimalBodyPoseObservation])
  • DetectHumanBodyPose3DRequest: A request that detects points on human bodies in 3D space, relative to the camera. ([HumanBodyPose3DObservation])
  • DetectHumanBodyPoseRequest: A request that detects a human body pose. ([HumanBodyPoseObservation])
  • DetectHumanHandPoseRequest: A request that detects a human hand pose. ([HumanHandPoseObservation])
  • Supporting Pose Types: Types you use when working with pose analysis. ([Chirality])

Image classification and recognition

  • Classifying images for categorization and search: Analyze and label images using a Vision classification request.
  • ClassifyImageRequest: A request to classify an image. ([ClassificationObservation])
  • DetectHumanRectanglesRequest: A request that finds rectangular regions that contain people in an image. ([HumanObservation])
  • RecognizeAnimalsRequest: A request that recognizes animals in an image. ([RecognizedObjectObservation])

Shape and edge detection

  • DetectContoursRequest: A request that detects the contours of the edges of an image. ([ContoursObservation])
  • DetectHorizonRequest: An image-analysis request that determines the horizon angle in an image. ([HorizonObservation])
  • DetectRectanglesRequest: An image-analysis request that finds projected rectangular regions in an image. ([RectangleObservation])

Image quality and saliency analysis

  • Generating high-quality thumbnails from videos: Identify the most visually pleasing frames in a video by using the image-aesthetics scores request.
  • CalculateImageAestheticsScoresRequest: A request that analyzes an image for aesthetically pleasing attributes. ([ImageAestheticsScoresObservation])
  • DetectLensSmudgeRequest: A request that detects a smudge on a lens from an image or video frame capture.
  • GenerateAttentionBasedSaliencyImageRequest: An object that produces a heat map that identifies the parts of an image most likely to draw attention. ([SaliencyImageObservation])
  • GenerateObjectnessBasedSaliencyImageRequest: A request that generates a heat map that identifies the parts of an image most likely to represent objects. ([SaliencyImageObservation])

Motion and object tracking

  • DetectTrajectoriesRequest: A request that detects the trajectories of shapes moving along a parabolic path. ([TrajectoryObservation])
  • TrackObjectRequest: An image-analysis request that tracks the movement of a previously identified object across multiple images or video frames. ([DetectedObjectObservation])
  • TrackOpticalFlowRequest: A request that determines the direction change of vectors for each pixel from a previous to current image.
  • TrackRectangleRequest: An image-analysis request that tracks movement of a previously identified rectangular object across multiple images or video frames. ([RectangleObservation])

Image registration and comparison

  • GenerateImageFeaturePrintRequest: An image-based request to generate feature prints from an image. ([FeaturePrintObservation])
  • TrackHomographicImageRegistrationRequest: An image-analysis request that you track over time to determine the perspective warp matrix necessary to align the content of two images. ([ImageHomographicAlignmentObservation])
  • TrackTranslationalImageRegistrationRequest: An image-analysis request that you track over time to determine the affine transform necessary to align the content of two images. ([ImageTranslationAlignmentObservation], [ComputeStage])

Custom Core ML integration

  • CoreMLRequest: An image-analysis request that uses a Core ML model to process images. ([PixelBufferObservation], [ClassificationObservation], [CoreMLFeatureValueObservation], [ComputeStage])

Protocols

  • ImageProcessingRequest: A type for image-analysis requests that focus on a specific part of an image.
  • PoseProviding: An observation that provides a collection of joints that make up a pose.
  • StatefulRequest: The protocol for a type that builds evidence of a condition over time.
  • TargetedRequest: A type for analyzing two images together.
  • VisionObservation: A type for objects produced by image-analysis requests.
  • VisionRequest: A type for image-analysis requests. ([ComputeStage])

Request handlers

  • ImageRequestHandler: An object that processes one or more image-analysis requests pertaining to a single image.
  • TargetedImageRequestHandler: An object that performs image-analysis requests on two images.
  • VideoProcessor: An object that performs offline analysis of video content.

Image locations and regions

  • NormalizedPoint: A point in a 2D coordinate system.
  • NormalizedRect: The location and dimensions of a rectangle.
  • NormalizedRegion: A polygon composed of normalized points.
  • NormalizedCircle: The center point and radius of a 2D circle.
  • BoundingBoxProviding: A protocol for objects that have a bounding box.
  • BoundingRegionProviding: A protocol for objects that have a defined boundary in an image.
  • QuadrilateralProviding: A protocol for objects that have a bounding quadrilateral.
  • CoordinateOrigin: The origin of a coordinate system relative to an image.

Errors

  • VisionError: The errors that the framework produces.

Legacy API

Key Types

Code generated from Apple documentation. DO NOT EDIT.

Index

Constants

View Source
const (
	VNCalculateImageAestheticsScoresRequestRevision1 uint = 1

	VNClassifyImageRequestRevision1 uint = 1

	VNClassifyImageRequestRevision2 uint = 2

	VNCoreMLRequestRevision1 uint = 1

	VNDetectAnimalBodyPoseRequestRevision1 uint = 1

	//
	// Deprecated: Deprecated since macOS 14.0. Use [VNDetectBarcodesRequestRevision3](<doc://Vision/documentation/Vision/VNDetectBarcodesRequestRevision3>) instead.
	VNDetectBarcodesRequestRevision1 uint = 1

	VNDetectBarcodesRequestRevision2 uint = 2

	VNDetectBarcodesRequestRevision3 uint = 3

	VNDetectBarcodesRequestRevision4 uint = 4

	VNDetectContourRequestRevision1 uint = 1

	VNDetectDocumentSegmentationRequestRevision1 uint = 1

	VNDetectFaceCaptureQualityRequestRevision1 uint = 1

	VNDetectFaceCaptureQualityRequestRevision2 uint = 2

	VNDetectFaceCaptureQualityRequestRevision3 uint = 3

	VNDetectFaceLandmarksRequestRevision2 uint = 2

	VNDetectFaceLandmarksRequestRevision3 uint = 3

	VNDetectFaceRectanglesRequestRevision2 uint = 2

	VNDetectFaceRectanglesRequestRevision3 uint = 3

	VNDetectHorizonRequestRevision1 uint = 1

	VNDetectHumanBodyPose3DRequestRevision1 uint = 1

	VNDetectHumanBodyPoseRequestRevision1 uint = 1

	VNDetectHumanHandPoseRequestRevision1 uint = 1

	VNDetectHumanRectanglesRequestRevision1 uint = 1

	VNDetectHumanRectanglesRequestRevision2 uint = 2

	VNDetectRectanglesRequestRevision1 uint = 1

	VNDetectTextRectanglesRequestRevision1 uint = 1

	VNDetectTrajectoriesRequestRevision1 uint = 1

	VNGenerateAttentionBasedSaliencyImageRequestRevision1 uint = 1

	VNGenerateAttentionBasedSaliencyImageRequestRevision2 uint = 2

	VNGenerateForegroundInstanceMaskRequestRevision1 uint = 1

	VNGenerateImageFeaturePrintRequestRevision1 uint = 1

	VNGenerateImageFeaturePrintRequestRevision2 uint = 2

	VNGenerateObjectnessBasedSaliencyImageRequestRevision1 uint = 1

	VNGenerateObjectnessBasedSaliencyImageRequestRevision2 uint = 2

	VNGenerateOpticalFlowRequestRevision1 uint = 1

	VNGenerateOpticalFlowRequestRevision2 uint = 2

	VNGeneratePersonInstanceMaskRequestRevision1 uint = 1

	VNGeneratePersonSegmentationRequestRevision1 uint = 1

	VNHomographicImageRegistrationRequestRevision1 uint = 1

	VNRecognizeAnimalsRequestRevision1 uint = 1

	VNRecognizeAnimalsRequestRevision2 uint = 2

	VNRecognizeTextRequestRevision1 uint = 1

	VNRecognizeTextRequestRevision2 uint = 2

	VNRecognizeTextRequestRevision3 uint = 3

	VNRequestRevisionUnspecified uint = 0

	VNTrackHomographicImageRegistrationRequestRevision1 uint = 1

	VNTrackObjectRequestRevision1 uint = 1

	VNTrackObjectRequestRevision2 uint = 2

	VNTrackOpticalFlowRequestRevision1 uint = 1

	VNTrackRectangleRequestRevision1 uint = 1

	VNTrackTranslationalImageRegistrationRequestRevision1 uint = 1

	VNTranslationalImageRegistrationRequestRevision1 uint = 1
)

Variables

View Source
var VNErrorDomain string
View Source
var VNNormalizedIdentityRect corefoundation.CGRect
View Source
var VNVisionVersionNumber float64

Functions

func NewErrorBlock

func NewErrorBlock(handler ErrorHandler) (objc.ID, func())

NewErrorBlock wraps a Go ErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.

Used by:

  • [VNCalculateImageAestheticsScoresRequest.InitWithCompletionHandler]
  • [VNClassifyImageRequest.InitWithCompletionHandler]
  • [VNCoreMLRequest.InitWithCompletionHandler]
  • VNCoreMLRequest.InitWithModelCompletionHandler
  • [VNDetectAnimalBodyPoseRequest.InitWithCompletionHandler]
  • [VNDetectBarcodesRequest.InitWithCompletionHandler]
  • [VNDetectContoursRequest.InitWithCompletionHandler]
  • [VNDetectDocumentSegmentationRequest.InitWithCompletionHandler]
  • [VNDetectFaceCaptureQualityRequest.InitWithCompletionHandler]
  • [VNDetectFaceLandmarksRequest.InitWithCompletionHandler]
  • [VNDetectFaceRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectHorizonRequest.InitWithCompletionHandler]
  • [VNDetectHumanBodyPose3DRequest.InitWithCompletionHandler]
  • [VNDetectHumanBodyPose3DRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNDetectHumanBodyPoseRequest.InitWithCompletionHandler]
  • [VNDetectHumanHandPoseRequest.InitWithCompletionHandler]
  • [VNDetectHumanRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectTextRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectTrajectoriesRequest.InitWithCompletionHandler]
  • [VNDetectTrajectoriesRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • VNDetectTrajectoriesRequest.InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler
  • [VNGenerateAttentionBasedSaliencyImageRequest.InitWithCompletionHandler]
  • [VNGenerateForegroundInstanceMaskRequest.InitWithCompletionHandler]
  • [VNGenerateImageFeaturePrintRequest.InitWithCompletionHandler]
  • [VNGenerateObjectnessBasedSaliencyImageRequest.InitWithCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • [VNGeneratePersonInstanceMaskRequest.InitWithCompletionHandler]
  • [VNGeneratePersonSegmentationRequest.InitWithCompletionHandler]
  • [VNGeneratePersonSegmentationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • [VNImageBasedRequest.InitWithCompletionHandler]
  • [VNImageRegistrationRequest.InitWithCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • VNInstanceMaskObservation.GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError
  • VNInstanceMaskObservation.GenerateScaledMaskForImageForInstancesFromRequestHandlerError
  • [VNRecognizeAnimalsRequest.InitWithCompletionHandler]
  • [VNRecognizeTextRequest.InitWithCompletionHandler]
  • VNRequest.InitWithCompletionHandler
  • [VNStatefulRequest.InitWithCompletionHandler]
  • VNStatefulRequest.InitWithFrameAnalysisSpacingCompletionHandler
  • [VNTargetedImageRequest.InitWithCompletionHandler]
  • VNTargetedImageRequest.InitWithTargetedCGImageOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCIImageOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageDataOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageURLOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler
  • [VNTrackHomographicImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTrackHomographicImageRegistrationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackObjectRequest.InitWithCompletionHandler]
  • VNTrackObjectRequest.InitWithDetectedObjectObservationCompletionHandler
  • [VNTrackOpticalFlowRequest.InitWithCompletionHandler]
  • [VNTrackOpticalFlowRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackRectangleRequest.InitWithCompletionHandler]
  • VNTrackRectangleRequest.InitWithRectangleObservationCompletionHandler
  • [VNTrackTranslationalImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTrackTranslationalImageRegistrationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackingRequest.InitWithCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]

func VNElementTypeSize

func VNElementTypeSize(elementType VNElementType) uint

VNElementTypeSize returns the size of a feature print element.

See: https://developer.apple.com/documentation/Vision/VNElementTypeSize(_:)

func VNImagePointForFaceLandmarkPoint

func VNImagePointForFaceLandmarkPoint(faceLandmarkPoint uintptr, faceBoundingBox corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr) corefoundation.CGPoint

VNImagePointForFaceLandmarkPoint returns the image coordinates of a specified face landmark point.

See: https://developer.apple.com/documentation/Vision/VNImagePointForFaceLandmarkPoint(_:_:_:_:)

func VNImagePointForNormalizedPoint

func VNImagePointForNormalizedPoint(normalizedPoint corefoundation.CGPoint, imageWidth uintptr, imageHeight uintptr) corefoundation.CGPoint

VNImagePointForNormalizedPoint projects a point in normalized coordinates into image coordinates.

See: https://developer.apple.com/documentation/Vision/VNImagePointForNormalizedPoint(_:_:_:)

func VNImagePointForNormalizedPointUsingRegionOfInterest

func VNImagePointForNormalizedPointUsingRegionOfInterest(normalizedPoint corefoundation.CGPoint, imageWidth uintptr, imageHeight uintptr, roi corefoundation.CGRect) corefoundation.CGPoint

VNImagePointForNormalizedPointUsingRegionOfInterest projects a point from a region of interest within the normalized coordinates into image coordinates.

See: https://developer.apple.com/documentation/Vision/VNImagePointForNormalizedPointUsingRegionOfInterest(_:_:_:_:)

func VNImageRectForNormalizedRect

func VNImageRectForNormalizedRect(normalizedRect corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr) corefoundation.CGRect

VNImageRectForNormalizedRect projects a rectangle from normalized coordinates into image coordinates.

See: https://developer.apple.com/documentation/Vision/VNImageRectForNormalizedRect(_:_:_:)

func VNImageRectForNormalizedRectUsingRegionOfInterest

func VNImageRectForNormalizedRectUsingRegionOfInterest(normalizedRect corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr, roi corefoundation.CGRect) corefoundation.CGRect

VNImageRectForNormalizedRectUsingRegionOfInterest projects a rectangle from a region of interest within the normalized coordinates into image coordinates.

See: https://developer.apple.com/documentation/Vision/VNImageRectForNormalizedRectUsingRegionOfInterest(_:_:_:_:)

func VNNormalizedFaceBoundingBoxPointForLandmarkPoint

func VNNormalizedFaceBoundingBoxPointForLandmarkPoint(faceLandmarkPoint uintptr, faceBoundingBox corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr) corefoundation.CGPoint

VNNormalizedFaceBoundingBoxPointForLandmarkPoint returns the coordinates of a specified face landmark point, in bounding box coordinates.

See: https://developer.apple.com/documentation/Vision/VNNormalizedFaceBoundingBoxPointForLandmarkPoint(_:_:_:_:)

func VNNormalizedPointForImagePoint

func VNNormalizedPointForImagePoint(imagePoint corefoundation.CGPoint, imageWidth uintptr, imageHeight uintptr) corefoundation.CGPoint

VNNormalizedPointForImagePoint projects a point from image coordinates into normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNNormalizedPointForImagePoint(_:_:_:)

func VNNormalizedPointForImagePointUsingRegionOfInterest

func VNNormalizedPointForImagePointUsingRegionOfInterest(imagePoint corefoundation.CGPoint, imageWidth uintptr, imageHeight uintptr, roi corefoundation.CGRect) corefoundation.CGPoint

VNNormalizedPointForImagePointUsingRegionOfInterest projects a point from a region of interest within the image coordinates into normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNNormalizedPointForImagePointUsingRegionOfInterest(_:_:_:_:)

func VNNormalizedRectForImageRect

func VNNormalizedRectForImageRect(imageRect corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr) corefoundation.CGRect

VNNormalizedRectForImageRect projects a rectangle from image coordinates into normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNNormalizedRectForImageRect(_:_:_:)

func VNNormalizedRectForImageRectUsingRegionOfInterest

func VNNormalizedRectForImageRectUsingRegionOfInterest(imageRect corefoundation.CGRect, imageWidth uintptr, imageHeight uintptr, roi corefoundation.CGRect) corefoundation.CGRect

VNNormalizedRectForImageRectUsingRegionOfInterest projects a rectangle from a region of interest within the image coordinates space into normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNNormalizedRectForImageRectUsingRegionOfInterest(_:_:_:_:)

func VNNormalizedRectIsIdentityRect

func VNNormalizedRectIsIdentityRect(normalizedRect corefoundation.CGRect) bool

VNNormalizedRectIsIdentityRect returns a Boolean value that indicates whether the rectangle has an origin of zero and unit length and width.

See: https://developer.apple.com/documentation/Vision/VNNormalizedRectIsIdentityRect(_:)

Types

type ErrorHandler

type ErrorHandler = func()

ErrorHandler handles The block to invoke after the request finishes processing.

Used by:

  • [VNCalculateImageAestheticsScoresRequest.InitWithCompletionHandler]
  • [VNClassifyImageRequest.InitWithCompletionHandler]
  • [VNCoreMLRequest.InitWithCompletionHandler]
  • VNCoreMLRequest.InitWithModelCompletionHandler
  • [VNDetectAnimalBodyPoseRequest.InitWithCompletionHandler]
  • [VNDetectBarcodesRequest.InitWithCompletionHandler]
  • [VNDetectContoursRequest.InitWithCompletionHandler]
  • [VNDetectDocumentSegmentationRequest.InitWithCompletionHandler]
  • [VNDetectFaceCaptureQualityRequest.InitWithCompletionHandler]
  • [VNDetectFaceLandmarksRequest.InitWithCompletionHandler]
  • [VNDetectFaceRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectHorizonRequest.InitWithCompletionHandler]
  • [VNDetectHumanBodyPose3DRequest.InitWithCompletionHandler]
  • [VNDetectHumanBodyPose3DRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNDetectHumanBodyPoseRequest.InitWithCompletionHandler]
  • [VNDetectHumanHandPoseRequest.InitWithCompletionHandler]
  • [VNDetectHumanRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectTextRectanglesRequest.InitWithCompletionHandler]
  • [VNDetectTrajectoriesRequest.InitWithCompletionHandler]
  • [VNDetectTrajectoriesRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • VNDetectTrajectoriesRequest.InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler
  • [VNGenerateAttentionBasedSaliencyImageRequest.InitWithCompletionHandler]
  • [VNGenerateForegroundInstanceMaskRequest.InitWithCompletionHandler]
  • [VNGenerateImageFeaturePrintRequest.InitWithCompletionHandler]
  • [VNGenerateObjectnessBasedSaliencyImageRequest.InitWithCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNGenerateOpticalFlowRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • [VNGeneratePersonInstanceMaskRequest.InitWithCompletionHandler]
  • [VNGeneratePersonSegmentationRequest.InitWithCompletionHandler]
  • [VNGeneratePersonSegmentationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNHomographicImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • [VNImageBasedRequest.InitWithCompletionHandler]
  • [VNImageRegistrationRequest.InitWithCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]
  • VNInstanceMaskObservation.GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError
  • VNInstanceMaskObservation.GenerateScaledMaskForImageForInstancesFromRequestHandlerError
  • [VNRecognizeAnimalsRequest.InitWithCompletionHandler]
  • [VNRecognizeTextRequest.InitWithCompletionHandler]
  • VNRequest.InitWithCompletionHandler
  • [VNStatefulRequest.InitWithCompletionHandler]
  • VNStatefulRequest.InitWithFrameAnalysisSpacingCompletionHandler
  • [VNTargetedImageRequest.InitWithCompletionHandler]
  • VNTargetedImageRequest.InitWithTargetedCGImageOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCIImageOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageDataOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageURLOptionsCompletionHandler
  • VNTargetedImageRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler
  • [VNTrackHomographicImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTrackHomographicImageRegistrationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackObjectRequest.InitWithCompletionHandler]
  • VNTrackObjectRequest.InitWithDetectedObjectObservationCompletionHandler
  • [VNTrackOpticalFlowRequest.InitWithCompletionHandler]
  • [VNTrackOpticalFlowRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackRectangleRequest.InitWithCompletionHandler]
  • VNTrackRectangleRequest.InitWithRectangleObservationCompletionHandler
  • [VNTrackTranslationalImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTrackTranslationalImageRegistrationRequest.InitWithFrameAnalysisSpacingCompletionHandler]
  • [VNTrackingRequest.InitWithCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCGImageOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCIImageOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageDataOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageURLOptionsCompletionHandler]
  • [VNTranslationalImageRegistrationRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]

type IVNAnimalBodyPoseObservation

type IVNAnimalBodyPoseObservation interface {
	IVNRecognizedPointsObservation

	// The names of the available joints in the observation.
	AvailableJointNames() []string
	// The available joint group names in the observation.
	AvailableJointGroupNames() []string
	// Returns the point for a joint name the observation recognizes.
	RecognizedPointForJointNameError(jointName VNAnimalBodyPoseObservationJointName) (IVNRecognizedPoint, error)
	// Returns the points for a joint group name the observation recognizes.
	RecognizedPointsForJointsGroupNameError(jointsGroupName VNAnimalBodyPoseObservationJointsGroupName) (foundation.INSDictionary, error)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNAnimalBodyPoseObservation class.

Accessing Points

  • [IVNAnimalBodyPoseObservation.AvailableJointNames]: The names of the available joints in the observation.
  • [IVNAnimalBodyPoseObservation.AvailableJointGroupNames]: The available joint group names in the observation.
  • [IVNAnimalBodyPoseObservation.RecognizedPointForJointNameError]: Returns the point for a joint name the observation recognizes.
  • [IVNAnimalBodyPoseObservation.RecognizedPointsForJointsGroupNameError]: Returns the points for a joint group name the observation recognizes.

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation

type IVNBarcodeObservation

type IVNBarcodeObservation interface {
	IVNRectangleObservation

	// A string value that represents the barcode payload.
	PayloadStringValue() string
	// The raw data representation of the barcode’s payload.
	PayloadData() foundation.INSData
	// The supplemental code decoded as a string value.
	SupplementalPayloadString() string
	SupplementalPayloadData() foundation.INSData
	// The supplemental composite type.
	SupplementalCompositeType() VNBarcodeCompositeType
	// A Boolean value that indicates whether the barcode carries any global standards data.
	IsGS1DataCarrier() bool

	// An object that describes the low-level details about the barcode and its data.
	BarcodeDescriptor() objectivec.IObject

	// The symbology of the observed barcode.
	Symbology() VNBarcodeSymbology

	// A Boolean value that indicates whether the barcode is color inverted.
	IsColorInverted() bool

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNBarcodeObservation class.

Parsing the Payload

  • [IVNBarcodeObservation.PayloadStringValue]: A string value that represents the barcode payload.
  • [IVNBarcodeObservation.PayloadData]: The raw data representation of the barcode’s payload.
  • [IVNBarcodeObservation.SupplementalPayloadString]: The supplemental code decoded as a string value.
  • [IVNBarcodeObservation.SupplementalPayloadData]
  • [IVNBarcodeObservation.SupplementalCompositeType]: The supplemental composite type.
  • [IVNBarcodeObservation.IsGS1DataCarrier]: A Boolean value that indicates whether the barcode carries any global standards data.

Reading Barcode Descriptors

  • [IVNBarcodeObservation.BarcodeDescriptor]: An object that describes the low-level details about the barcode and its data.

Identifying Barcode Types

  • [IVNBarcodeObservation.Symbology]: The symbology of the observed barcode.

Identifying Barcode Colors

  • [IVNBarcodeObservation.IsColorInverted]: A Boolean value that indicates whether the barcode is color inverted.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation

type IVNCircle

type IVNCircle interface {
	objectivec.IObject

	// Creates a circle with the specified center and radius.
	InitWithCenterRadius(center IVNPoint, radius float64) VNCircle
	// Creates a circle with the specified center and diameter.
	InitWithCenterDiameter(center IVNPoint, diameter float64) VNCircle

	// The circle’s center point.
	Center() IVNPoint
	// The circle’s diameter.
	Diameter() float64
	// The circle’s radius.
	Radius() float64
	// Determines if this circle, including its boundary, contains the specified point.
	ContainsPoint(point IVNPoint) bool
	// Determines if a ring around this circle’s circumference contains the specified point.
	ContainsPointInCircumferentialRingOfWidth(point IVNPoint, ringWidth float64) bool

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNCircle class.

Creating a Circle

  • [IVNCircle.InitWithCenterRadius]: Creates a circle with the specified center and radius.
  • [IVNCircle.InitWithCenterDiameter]: Creates a circle with the specified center and diameter.

Inspecting a Circle

  • [IVNCircle.Center]: The circle’s center point.
  • [IVNCircle.Diameter]: The circle’s diameter.
  • [IVNCircle.Radius]: The circle’s radius.
  • [IVNCircle.ContainsPoint]: Determines if this circle, including its boundary, contains the specified point.
  • [IVNCircle.ContainsPointInCircumferentialRingOfWidth]: Determines if a ring around this circle’s circumference contains the specified point.

See: https://developer.apple.com/documentation/Vision/VNCircle

type IVNClassificationObservation

type IVNClassificationObservation interface {
	IVNObservation

	// Classification label identifying the type of observation.
	Identifier() string

	// A Boolean variable indicating whether the observation contains precision and recall curves.
	HasPrecisionRecallCurve() bool
	// Determines whether the observation for a specific recall has a minimum precision value.
	HasMinimumPrecisionForRecall(minimumPrecision float32, recall float32) bool
	// Determines whether the observation for a specific precision has a minimum recall value.
	HasMinimumRecallForPrecision(minimumRecall float32, precision float32) bool

	// Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.
	ModelDescription() coreml.MLModelDescription
	SetModelDescription(value coreml.MLModelDescription)
	// The name of the primary prediction feature output description.
	PredictedFeatureName() string
	SetPredictedFeatureName(value string)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNClassificationObservation class.

Determining Classification

  • [IVNClassificationObservation.Identifier]: Classification label identifying the type of observation.

Measuring Confidence and Precision

  • [IVNClassificationObservation.HasPrecisionRecallCurve]: A Boolean variable indicating whether the observation contains precision and recall curves.
  • [IVNClassificationObservation.HasMinimumPrecisionForRecall]: Determines whether the observation for a specific recall has a minimum precision value.
  • [IVNClassificationObservation.HasMinimumRecallForPrecision]: Determines whether the observation for a specific precision has a minimum recall value.

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation

type IVNClassifyImageRequest

type IVNClassifyImageRequest interface {
	IVNImageBasedRequest

	// Returns the classification identifiers that the request supports in its current configuration.
	SupportedIdentifiersAndReturnError() ([]string, error)

	// A constant for specifying the first revision of the image-classification request.
	VNClassifyImageRequestRevision1() int
}

An interface definition for the VNClassifyImageRequest class.

Accessing Results

  • [IVNClassifyImageRequest.SupportedIdentifiersAndReturnError]: Returns the classification identifiers that the request supports in its current configuration.

Specifying Algorithm Revision

  • [IVNClassifyImageRequest.VNClassifyImageRequestRevision1]: A constant for specifying the first revision of the image-classification request.

See: https://developer.apple.com/documentation/Vision/VNClassifyImageRequest

type IVNContour

type IVNContour interface {
	objectivec.IObject
	VNRequestRevisionProviding

	// The aspect ratio of the contour.
	AspectRatio() float32
	// The contour object’s index path.
	IndexPath() objc.ID
	// The contour object as a path in normalized coordinates.
	NormalizedPath() coregraphics.CGPathRef
	// The contour’s number of points.
	PointCount() int
	// Simplifies the contour to a polygon using a Ramer-Douglas-Peucker algorithm.
	PolygonApproximationWithEpsilonError(epsilon float32) (IVNContour, error)

	// The total number of detected child contours.
	ChildContourCount() int
	// An array of contours that this contour encloses.
	ChildContours() []VNContour
	// Retrieves the child contour object at the specified index.
	ChildContourAtIndexError(childContourIndex uint) (IVNContour, error)

	// The contour’s array of points in normalized coordinates.
	NormalizedPoints() objectivec.IObject
	// The total number of detected contours.
	ContourCount() int
	SetContourCount(value int)
	// The total number of detected top-level contours.
	TopLevelContourCount() int
	SetTopLevelContourCount(value int)
	// An array of contours that don’t have another contour enclosing them.
	TopLevelContours() IVNContour
	SetTopLevelContours(value IVNContour)
}

An interface definition for the VNContour class.

Inspecting the Contour

  • [IVNContour.AspectRatio]: The aspect ratio of the contour.
  • [IVNContour.IndexPath]: The contour object’s index path.
  • [IVNContour.NormalizedPath]: The contour object as a path in normalized coordinates.
  • [IVNContour.PointCount]: The contour’s number of points.
  • [IVNContour.PolygonApproximationWithEpsilonError]: Simplifies the contour to a polygon using a Ramer-Douglas-Peucker algorithm.

Accessing Child Contours

  • [IVNContour.ChildContourCount]: The total number of detected child contours.
  • [IVNContour.ChildContours]: An array of contours that this contour encloses.
  • [IVNContour.ChildContourAtIndexError]: Retrieves the child contour object at the specified index.

See: https://developer.apple.com/documentation/Vision/VNContour

type IVNContoursObservation

type IVNContoursObservation interface {
	IVNObservation

	// The total number of detected contours.
	ContourCount() int
	// The detected contours as a path object in normalized coordinates.
	NormalizedPath() coregraphics.CGPathRef
	// An array of contours that don’t have another contour enclosing them.
	TopLevelContours() []VNContour
	// The total number of detected top-level contours.
	TopLevelContourCount() int
	// Retrieves the contour object at the specified index, irrespective of hierarchy.
	ContourAtIndexError(contourIndex int) (IVNContour, error)
	// Retrieves the contour object at the specified index path.
	ContourAtIndexPathError(indexPath objectivec.IObject) (IVNContour, error)

	// The results of the request to detect contours.
	Results() IVNContoursObservation
	SetResults(value IVNContoursObservation)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNContoursObservation class.

Inspecting the Observation

  • [IVNContoursObservation.ContourCount]: The total number of detected contours.
  • [IVNContoursObservation.NormalizedPath]: The detected contours as a path object in normalized coordinates.
  • [IVNContoursObservation.TopLevelContours]: An array of contours that don’t have another contour enclosing them.
  • [IVNContoursObservation.TopLevelContourCount]: The total number of detected top-level contours.
  • [IVNContoursObservation.ContourAtIndexError]: Retrieves the contour object at the specified index, irrespective of hierarchy.
  • [IVNContoursObservation.ContourAtIndexPathError]: Retrieves the contour object at the specified index path.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation

type IVNCoreMLFeatureValueObservation

type IVNCoreMLFeatureValueObservation interface {
	IVNObservation

	// The feature result of a [VNCoreMLRequest](<doc://Vision/documentation/Vision/VNCoreMLRequest>) that outputs neither a classification nor an image.
	FeatureValue() coreml.MLFeatureValue
	// The name used in the model description of the CoreML model that produced this observation.
	FeatureName() string

	// Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.
	ModelDescription() coreml.MLModelDescription
	SetModelDescription(value coreml.MLModelDescription)
	// A dictionary of output feature descriptions, which the model keys by the output’s name.
	OutputDescriptionsByName() coreml.MLFeatureDescription
	SetOutputDescriptionsByName(value coreml.MLFeatureDescription)
	// The name of the primary prediction feature output description.
	PredictedFeatureName() string
	SetPredictedFeatureName(value string)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNCoreMLFeatureValueObservation class.

Obtaining Feature Values

  • [IVNCoreMLFeatureValueObservation.FeatureValue]: The feature result of a VNCoreMLRequest(<doc://Vision/documentation/Vision/VNCoreMLRequest>) that outputs neither a classification nor an image.
  • [IVNCoreMLFeatureValueObservation.FeatureName]: The name used in the model description of the CoreML model that produced this observation.

See: https://developer.apple.com/documentation/Vision/VNCoreMLFeatureValueObservation

type IVNCoreMLModel

type IVNCoreMLModel interface {
	objectivec.IObject

	// An optional object to support inputs outside Vision.
	FeatureProvider() coreml.MLFeatureProvider
	SetFeatureProvider(value coreml.MLFeatureProvider)
	// The name of the feature value that Vision sets from the request handler.
	InputImageFeatureName() string
	SetInputImageFeatureName(value string)

	// The model to base the image analysis request on.
	Model() IVNCoreMLModel
	SetModel(value IVNCoreMLModel)
}

An interface definition for the VNCoreMLModel class.

Providing Features

  • [IVNCoreMLModel.FeatureProvider]: An optional object to support inputs outside Vision.
  • [IVNCoreMLModel.SetFeatureProvider]
  • [IVNCoreMLModel.InputImageFeatureName]: The name of the feature value that Vision sets from the request handler.
  • [IVNCoreMLModel.SetInputImageFeatureName]

See: https://developer.apple.com/documentation/Vision/VNCoreMLModel

type IVNCoreMLRequest

type IVNCoreMLRequest interface {
	IVNImageBasedRequest

	// Creates a model container to use with an image analysis request based on the model you provide.
	InitWithModel(model IVNCoreMLModel) VNCoreMLRequest
	// Creates a model container to use with an image analysis request based on the model you provide, with an optional completion handler.
	InitWithModelCompletionHandler(model IVNCoreMLModel, completionHandler ErrorHandler) VNCoreMLRequest
	// The model to base the image analysis request on.
	Model() IVNCoreMLModel

	// An optional setting that tells the Vision algorithm how to scale an input image.
	ImageCropAndScaleOption() VNImageCropAndScaleOption
	SetImageCropAndScaleOption(value VNImageCropAndScaleOption)

	// A constant for specifying revision 1 of a Core ML request.
	VNCoreMLRequestRevision1() int

	// The level of confidence in the observation’s accuracy.
	Confidence() VNConfidence
	SetConfidence(value VNConfidence)
	// Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.
	ModelDescription() coreml.MLModelDescription
	SetModelDescription(value coreml.MLModelDescription)
	// The name of the primary prediction feature output description.
	PredictedFeatureName() string
	SetPredictedFeatureName(value string)
}

An interface definition for the VNCoreMLRequest class.

Initializing with a Core ML Model

  • [IVNCoreMLRequest.InitWithModel]: Creates a model container to use with an image analysis request based on the model you provide.
  • [IVNCoreMLRequest.InitWithModelCompletionHandler]: Creates a model container to use with an image analysis request based on the model you provide, with an optional completion handler.
  • [IVNCoreMLRequest.Model]: The model to base the image analysis request on.

Configuring Image Options

  • [IVNCoreMLRequest.ImageCropAndScaleOption]: An optional setting that tells the Vision algorithm how to scale an input image.
  • [IVNCoreMLRequest.SetImageCropAndScaleOption]

Identifying Request Revisions

  • [IVNCoreMLRequest.VNCoreMLRequestRevision1]: A constant for specifying revision 1 of a Core ML request.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest

type IVNDetectAnimalBodyPoseRequest

type IVNDetectAnimalBodyPoseRequest interface {
	IVNImageBasedRequest

	// Retrieves the joint names the request supports.
	SupportedJointNames() VNAnimalBodyPoseObservationJointName
	SetSupportedJointNames(value VNAnimalBodyPoseObservationJointName)
	// Retrieves the joint group names the request supports.
	SupportedJointsGroupNames() VNAnimalBodyPoseObservationJointsGroupName
	SetSupportedJointsGroupNames(value VNAnimalBodyPoseObservationJointsGroupName)

	// Retrieves the joint names the request supports.
	SupportedJointNamesAndReturnError() ([]string, error)
	// Retrieves the joint group names the request supports.
	SupportedJointsGroupNamesAndReturnError() ([]string, error)
}

An interface definition for the VNDetectAnimalBodyPoseRequest class.

Determining Supported Joints

  • [IVNDetectAnimalBodyPoseRequest.SupportedJointNames]: Retrieves the joint names the request supports.
  • [IVNDetectAnimalBodyPoseRequest.SetSupportedJointNames]
  • [IVNDetectAnimalBodyPoseRequest.SupportedJointsGroupNames]: Retrieves the joint group names the request supports.
  • [IVNDetectAnimalBodyPoseRequest.SetSupportedJointsGroupNames]

See: https://developer.apple.com/documentation/Vision/VNDetectAnimalBodyPoseRequest

type IVNDetectBarcodesRequest

type IVNDetectBarcodesRequest interface {
	IVNImageBasedRequest

	// Returns the barcode symbologies that the request supports.
	SupportedSymbologiesAndReturnError() ([]string, error)
	// The barcode symbologies that the request detects in an image.
	Symbologies() []string
	SetSymbologies(value []string)
	// A Boolean value that indicates whether to coalesce multiple codes based on the symbology.
	CoalesceCompositeSymbologies() bool
	SetCoalesceCompositeSymbologies(value bool)

	// A constant for specifying revision 3 of the barcode detection request.
	VNDetectBarcodesRequestRevision3() int
	// A constant for specifying revision 2 of the barcode detection request.
	VNDetectBarcodesRequestRevision2() int
	// A constant for specifying revision 1 of the barcode detection request.
	VNDetectBarcodesRequestRevision1() int
}

An interface definition for the VNDetectBarcodesRequest class.

Specifying Symbologies

  • [IVNDetectBarcodesRequest.SupportedSymbologiesAndReturnError]: Returns the barcode symbologies that the request supports.
  • [IVNDetectBarcodesRequest.Symbologies]: The barcode symbologies that the request detects in an image.
  • [IVNDetectBarcodesRequest.SetSymbologies]
  • [IVNDetectBarcodesRequest.CoalesceCompositeSymbologies]: A Boolean value that indicates whether to coalesce multiple codes based on the symbology.
  • [IVNDetectBarcodesRequest.SetCoalesceCompositeSymbologies]

Identifying Request Revisions

  • [IVNDetectBarcodesRequest.VNDetectBarcodesRequestRevision3]: A constant for specifying revision 3 of the barcode detection request.
  • [IVNDetectBarcodesRequest.VNDetectBarcodesRequestRevision2]: A constant for specifying revision 2 of the barcode detection request.
  • [IVNDetectBarcodesRequest.VNDetectBarcodesRequestRevision1]: A constant for specifying revision 1 of the barcode detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectBarcodesRequest

type IVNDetectContoursRequest

type IVNDetectContoursRequest interface {
	IVNImageBasedRequest

	// The amount by which to adjust the image contrast.
	ContrastAdjustment() float32
	SetContrastAdjustment(value float32)
	// The pixel value to use as a pivot for the contrast.
	ContrastPivot() foundation.NSNumber
	SetContrastPivot(value foundation.NSNumber)
	// A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection.
	DetectsDarkOnLight() bool
	SetDetectsDarkOnLight(value bool)
	// The maximum image dimension to use for contour detection.
	MaximumImageDimension() uint
	SetMaximumImageDimension(value uint)

	// A constant for specifying revision 1 of the contours detection request.
	VNDetectContourRequestRevision1() int
}

An interface definition for the VNDetectContoursRequest class.

Configuring the Request

  • [IVNDetectContoursRequest.ContrastAdjustment]: The amount by which to adjust the image contrast.
  • [IVNDetectContoursRequest.SetContrastAdjustment]
  • [IVNDetectContoursRequest.ContrastPivot]: The pixel value to use as a pivot for the contrast.
  • [IVNDetectContoursRequest.SetContrastPivot]
  • [IVNDetectContoursRequest.DetectsDarkOnLight]: A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection.
  • [IVNDetectContoursRequest.SetDetectsDarkOnLight]
  • [IVNDetectContoursRequest.MaximumImageDimension]: The maximum image dimension to use for contour detection.
  • [IVNDetectContoursRequest.SetMaximumImageDimension]

Identifying Request Revisions

  • [IVNDetectContoursRequest.VNDetectContourRequestRevision1]: A constant for specifying revision 1 of the contours detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest

type IVNDetectDocumentSegmentationRequest

type IVNDetectDocumentSegmentationRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 1 of the document segmentation request.
	VNDetectDocumentSegmentationRequestRevision1() int
}

An interface definition for the VNDetectDocumentSegmentationRequest class.

Identifying Request Revisions

  • [IVNDetectDocumentSegmentationRequest.VNDetectDocumentSegmentationRequestRevision1]: A constant for specifying revision 1 of the document segmentation request.

See: https://developer.apple.com/documentation/Vision/VNDetectDocumentSegmentationRequest

type IVNDetectFaceCaptureQualityRequest

type IVNDetectFaceCaptureQualityRequest interface {
	IVNImageBasedRequest
	VNFaceObservationAccepting

	// Revision 2 of the request algorithm.
	VNDetectFaceCaptureQualityRequestRevision2() int
	// A constant for specifying revision 1 of the face capture detection request.
	VNDetectFaceCaptureQualityRequestRevision1() int

	// A value that indicates the quality of the face capture.
	FaceCaptureQuality() float32
	SetFaceCaptureQuality(value float32)
}

An interface definition for the VNDetectFaceCaptureQualityRequest class.

Identifying Request Revisions

  • [IVNDetectFaceCaptureQualityRequest.VNDetectFaceCaptureQualityRequestRevision2]: Revision 2 of the request algorithm.
  • [IVNDetectFaceCaptureQualityRequest.VNDetectFaceCaptureQualityRequestRevision1]: A constant for specifying revision 1 of the face capture detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectFaceCaptureQualityRequest

type IVNDetectFaceLandmarksRequest

type IVNDetectFaceLandmarksRequest interface {
	IVNImageBasedRequest

	// A variable that describes how a face landmarks request orders or enumerates the resulting features.
	Constellation() VNRequestFaceLandmarksConstellation
	SetConstellation(value VNRequestFaceLandmarksConstellation)

	// A constant for specifying revision 3 of the face landmarks detection request.
	VNDetectFaceLandmarksRequestRevision3() int
	// A constant for specifying revision 2 of the face landmarks detection request.
	VNDetectFaceLandmarksRequestRevision2() int
	// A constant for specifying revision 1 of the face landmarks detection request.
	VNDetectFaceLandmarksRequestRevision1() int
}

An interface definition for the VNDetectFaceLandmarksRequest class.

Locating Face Landmarks

  • [IVNDetectFaceLandmarksRequest.Constellation]: A variable that describes how a face landmarks request orders or enumerates the resulting features.
  • [IVNDetectFaceLandmarksRequest.SetConstellation]

Identifying Request Revisions

  • [IVNDetectFaceLandmarksRequest.VNDetectFaceLandmarksRequestRevision3]: A constant for specifying revision 3 of the face landmarks detection request.
  • [IVNDetectFaceLandmarksRequest.VNDetectFaceLandmarksRequestRevision2]: A constant for specifying revision 2 of the face landmarks detection request.
  • [IVNDetectFaceLandmarksRequest.VNDetectFaceLandmarksRequestRevision1]: A constant for specifying revision 1 of the face landmarks detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectFaceLandmarksRequest

type IVNDetectFaceRectanglesRequest

type IVNDetectFaceRectanglesRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 3 of the face rectangles detection request.
	VNDetectFaceRectanglesRequestRevision3() int
	// A constant for specifying revision 2 of the face rectangles detection request.
	VNDetectFaceRectanglesRequestRevision2() int
	// A constant for specifying revision 1 of the face rectangles detection request.
	VNDetectFaceRectanglesRequestRevision1() int
}

An interface definition for the VNDetectFaceRectanglesRequest class.

Identifying Request Revisions

  • [IVNDetectFaceRectanglesRequest.VNDetectFaceRectanglesRequestRevision3]: A constant for specifying revision 3 of the face rectangles detection request.
  • [IVNDetectFaceRectanglesRequest.VNDetectFaceRectanglesRequestRevision2]: A constant for specifying revision 2 of the face rectangles detection request.
  • [IVNDetectFaceRectanglesRequest.VNDetectFaceRectanglesRequestRevision1]: A constant for specifying revision 1 of the face rectangles detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectFaceRectanglesRequest

type IVNDetectHorizonRequest

type IVNDetectHorizonRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 1 of the horizon detection request.
	VNDetectHorizonRequestRevision1() int
}

An interface definition for the VNDetectHorizonRequest class.

Identifying Request Revisions

  • [IVNDetectHorizonRequest.VNDetectHorizonRequestRevision1]: A constant for specifying revision 1 of the horizon detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectHorizonRequest

type IVNDetectHumanBodyPose3DRequest

type IVNDetectHumanBodyPose3DRequest interface {
	IVNStatefulRequest

	// Returns the joint names the request supports.
	SupportedJointsGroupNames() VNHumanBodyPose3DObservationJointsGroupName
	SetSupportedJointsGroupNames(value VNHumanBodyPose3DObservationJointsGroupName)
	// Returns the joint group names the request supports.
	SupportedJointNames() VNHumanBodyPose3DObservationJointName
	SetSupportedJointNames(value VNHumanBodyPose3DObservationJointName)

	// Returns the joint names the request supports.
	SupportedJointNamesAndReturnError() ([]string, error)
	// Returns the joint group names the request supports.
	SupportedJointsGroupNamesAndReturnError() ([]string, error)
}

An interface definition for the VNDetectHumanBodyPose3DRequest class.

Determining Supported Joints

  • [IVNDetectHumanBodyPose3DRequest.SupportedJointsGroupNames]: Returns the joint names the request supports.
  • [IVNDetectHumanBodyPose3DRequest.SetSupportedJointsGroupNames]
  • [IVNDetectHumanBodyPose3DRequest.SupportedJointNames]: Returns the joint group names the request supports.
  • [IVNDetectHumanBodyPose3DRequest.SetSupportedJointNames]

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPose3DRequest

type IVNDetectHumanBodyPoseRequest

type IVNDetectHumanBodyPoseRequest interface {
	IVNImageBasedRequest

	// Retrieves the supported joint names.
	SupportedJointNames() VNHumanBodyPoseObservationJointName
	SetSupportedJointNames(value VNHumanBodyPoseObservationJointName)
	// Retrieves the supported joint group names.
	SupportedJointsGroupNames() VNHumanBodyPoseObservationJointsGroupName
	SetSupportedJointsGroupNames(value VNHumanBodyPoseObservationJointsGroupName)

	// A constant for specifying revision 1 of the body pose detection request.
	VNDetectHumanBodyPoseRequestRevision1() int

	// Retrieves the supported joint names.
	SupportedJointNamesAndReturnError() ([]string, error)
	// Retrieves the supported joint group names.
	SupportedJointsGroupNamesAndReturnError() ([]string, error)
}

An interface definition for the VNDetectHumanBodyPoseRequest class.

Determining Supported Joints

  • [IVNDetectHumanBodyPoseRequest.SupportedJointNames]: Retrieves the supported joint names.
  • [IVNDetectHumanBodyPoseRequest.SetSupportedJointNames]
  • [IVNDetectHumanBodyPoseRequest.SupportedJointsGroupNames]: Retrieves the supported joint group names.
  • [IVNDetectHumanBodyPoseRequest.SetSupportedJointsGroupNames]

Identifying Body Pose Revisions

  • [IVNDetectHumanBodyPoseRequest.VNDetectHumanBodyPoseRequestRevision1]: A constant for specifying revision 1 of the body pose detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPoseRequest

type IVNDetectHumanHandPoseRequest

type IVNDetectHumanHandPoseRequest interface {
	IVNImageBasedRequest

	// The maximum number of hands to detect in an image.
	MaximumHandCount() uint
	SetMaximumHandCount(value uint)

	// Retrieves the supported joint names.
	SupportedJointNames() VNHumanHandPoseObservationJointName
	SetSupportedJointNames(value VNHumanHandPoseObservationJointName)
	// Retrieves the supported joint group names.
	SupportedJointsGroupNames() VNHumanHandPoseObservationJointsGroupName
	SetSupportedJointsGroupNames(value VNHumanHandPoseObservationJointsGroupName)

	// A constant for specifying revision 1 of the hand pose detection request.
	VNDetectHumanHandPoseRequestRevision1() int

	// Retrieves the supported joint names.
	SupportedJointNamesAndReturnError() ([]string, error)
	// Retrieves the supported joint group names.
	SupportedJointsGroupNamesAndReturnError() ([]string, error)
}

An interface definition for the VNDetectHumanHandPoseRequest class.

Configuring the Request

  • [IVNDetectHumanHandPoseRequest.MaximumHandCount]: The maximum number of hands to detect in an image.
  • [IVNDetectHumanHandPoseRequest.SetMaximumHandCount]

Determining Supported Joints

  • [IVNDetectHumanHandPoseRequest.SupportedJointNames]: Retrieves the supported joint names.
  • [IVNDetectHumanHandPoseRequest.SetSupportedJointNames]
  • [IVNDetectHumanHandPoseRequest.SupportedJointsGroupNames]: Retrieves the supported joint group names.
  • [IVNDetectHumanHandPoseRequest.SetSupportedJointsGroupNames]

Identifying Hand Pose Revisions

  • [IVNDetectHumanHandPoseRequest.VNDetectHumanHandPoseRequestRevision1]: A constant for specifying revision 1 of the hand pose detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanHandPoseRequest

type IVNDetectHumanRectanglesRequest

type IVNDetectHumanRectanglesRequest interface {
	IVNImageBasedRequest

	// A Boolean value that indicates whether the request requires detecting a full body or upper body only to produce a result.
	UpperBodyOnly() bool
	SetUpperBodyOnly(value bool)

	// A constant for specifying revision 2 of the human rectangles detection request.
	VNDetectHumanRectanglesRequestRevision2() int
	// A constant for specifying revision 1 of the human rectangles detection request.
	VNDetectHumanRectanglesRequestRevision1() int
}

An interface definition for the VNDetectHumanRectanglesRequest class.

Configuring the Request

  • [IVNDetectHumanRectanglesRequest.UpperBodyOnly]: A Boolean value that indicates whether the request requires detecting a full body or upper body only to produce a result.
  • [IVNDetectHumanRectanglesRequest.SetUpperBodyOnly]

Identifying Request Revisions

  • [IVNDetectHumanRectanglesRequest.VNDetectHumanRectanglesRequestRevision2]: A constant for specifying revision 2 of the human rectangles detection request.
  • [IVNDetectHumanRectanglesRequest.VNDetectHumanRectanglesRequestRevision1]: A constant for specifying revision 1 of the human rectangles detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanRectanglesRequest

type IVNDetectRectanglesRequest

type IVNDetectRectanglesRequest interface {
	IVNImageBasedRequest

	// A `float` specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
	MinimumAspectRatio() VNAspectRatio
	SetMinimumAspectRatio(value VNAspectRatio)
	// A `float` specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
	MaximumAspectRatio() VNAspectRatio
	SetMaximumAspectRatio(value VNAspectRatio)
	// A float specifying the number of degrees a rectangle corner angle can deviate from 90°.
	QuadratureTolerance() VNDegrees
	SetQuadratureTolerance(value VNDegrees)
	// The minimum size of a rectangle to detect, as a proportion of the smallest dimension.
	MinimumSize() float32
	SetMinimumSize(value float32)
	// A value specifying the minimum acceptable confidence level.
	MinimumConfidence() VNConfidence
	SetMinimumConfidence(value VNConfidence)
	// An integer specifying the maximum number of rectangles Vision returns.
	MaximumObservations() uint
	SetMaximumObservations(value uint)

	// A constant for specifying revision 1 of the rectangle detection request.
	VNDetectRectanglesRequestRevision1() int
}

An interface definition for the VNDetectRectanglesRequest class.

Configuring Detection

  • [IVNDetectRectanglesRequest.MinimumAspectRatio]: A `float` specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
  • [IVNDetectRectanglesRequest.SetMinimumAspectRatio]
  • [IVNDetectRectanglesRequest.MaximumAspectRatio]: A `float` specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.
  • [IVNDetectRectanglesRequest.SetMaximumAspectRatio]
  • [IVNDetectRectanglesRequest.QuadratureTolerance]: A float specifying the number of degrees a rectangle corner angle can deviate from 90°.
  • [IVNDetectRectanglesRequest.SetQuadratureTolerance]
  • [IVNDetectRectanglesRequest.MinimumSize]: The minimum size of a rectangle to detect, as a proportion of the smallest dimension.
  • [IVNDetectRectanglesRequest.SetMinimumSize]
  • [IVNDetectRectanglesRequest.MinimumConfidence]: A value specifying the minimum acceptable confidence level.
  • [IVNDetectRectanglesRequest.SetMinimumConfidence]
  • [IVNDetectRectanglesRequest.MaximumObservations]: An integer specifying the maximum number of rectangles Vision returns.
  • [IVNDetectRectanglesRequest.SetMaximumObservations]

Identifying Request Revisions

  • [IVNDetectRectanglesRequest.VNDetectRectanglesRequestRevision1]: A constant for specifying revision 1 of the rectangle detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest

type IVNDetectTextRectanglesRequest

type IVNDetectTextRectanglesRequest interface {
	IVNImageBasedRequest

	// A Boolean value that indicates whether the request detects character bounding boxes.
	ReportCharacterBoxes() bool
	SetReportCharacterBoxes(value bool)

	// A constant for specifying revision 1 of the text rectangles detection request.
	VNDetectTextRectanglesRequestRevision1() int
}

An interface definition for the VNDetectTextRectanglesRequest class.

Configuring a Request

  • [IVNDetectTextRectanglesRequest.ReportCharacterBoxes]: A Boolean value that indicates whether the request detects character bounding boxes.
  • [IVNDetectTextRectanglesRequest.SetReportCharacterBoxes]

Identifying Request Revisions

  • [IVNDetectTextRectanglesRequest.VNDetectTextRectanglesRequestRevision1]: A constant for specifying revision 1 of the text rectangles detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectTextRectanglesRequest

type IVNDetectTrajectoriesRequest

type IVNDetectTrajectoriesRequest interface {
	IVNStatefulRequest

	// Creates a new request to detect trajectories.
	InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing objectivec.IObject, trajectoryLength int, completionHandler ErrorHandler) VNDetectTrajectoriesRequest

	// The requested target frame time for processing trajectory detection.
	TargetFrameTime() objectivec.IObject
	SetTargetFrameTime(value objectivec.IObject)
	// The number of points to detect before calculating a trajectory.
	TrajectoryLength() int
	// The minimum radius of the bounding circle of the object to track.
	ObjectMinimumNormalizedRadius() float32
	SetObjectMinimumNormalizedRadius(value float32)
	// The maximum radius of the bounding circle of the object to track.
	ObjectMaximumNormalizedRadius() float32
	SetObjectMaximumNormalizedRadius(value float32)

	// A constant for specifying revision 1 of the trajectories detection request.
	VNDetectTrajectoriesRequestRevision1() int
}

An interface definition for the VNDetectTrajectoriesRequest class.

Creating a Request

  • [IVNDetectTrajectoriesRequest.InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler]: Creates a new request to detect trajectories.

Configuring the Request

  • [IVNDetectTrajectoriesRequest.TargetFrameTime]: The requested target frame time for processing trajectory detection.
  • [IVNDetectTrajectoriesRequest.SetTargetFrameTime]
  • [IVNDetectTrajectoriesRequest.TrajectoryLength]: The number of points to detect before calculating a trajectory.
  • [IVNDetectTrajectoriesRequest.ObjectMinimumNormalizedRadius]: The minimum radius of the bounding circle of the object to track.
  • [IVNDetectTrajectoriesRequest.SetObjectMinimumNormalizedRadius]
  • [IVNDetectTrajectoriesRequest.ObjectMaximumNormalizedRadius]: The maximum radius of the bounding circle of the object to track.
  • [IVNDetectTrajectoriesRequest.SetObjectMaximumNormalizedRadius]

Identifying Request Revisions

  • [IVNDetectTrajectoriesRequest.VNDetectTrajectoriesRequestRevision1]: A constant for specifying revision 1 of the trajectories detection request.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest

type IVNDetectedObjectObservation

type IVNDetectedObjectObservation interface {
	IVNObservation

	// The bounding box of the object that the request detects.
	BoundingBox() corefoundation.CGRect

	// A resulting pixel buffer from a request to generate a segmentation mask for an image.
	GlobalSegmentationMask() IVNPixelBufferObservation

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNDetectedObjectObservation class.

Locating a Detected Object

  • [IVNDetectedObjectObservation.BoundingBox]: The bounding box of the object that the request detects.

Accessing an Image Mask

  • [IVNDetectedObjectObservation.GlobalSegmentationMask]: A resulting pixel buffer from a request to generate a segmentation mask for an image.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation

type IVNDetectedPoint

type IVNDetectedPoint interface {
	IVNPoint

	// A confidence score that indicates the detected point’s accuracy.
	Confidence() VNConfidence

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNDetectedPoint class.

Inspecting a Point

  • [IVNDetectedPoint.Confidence]: A confidence score that indicates the detected point’s accuracy.

See: https://developer.apple.com/documentation/Vision/VNDetectedPoint

type IVNFaceLandmarkRegion

type IVNFaceLandmarkRegion interface {
	objectivec.IObject
	VNRequestRevisionProviding

	// The number of points in the face region.
	PointCount() uint

	// The facial features of the detected face.
	Landmarks() IVNFaceLandmarks2D
	SetLandmarks(value IVNFaceLandmarks2D)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFaceLandmarkRegion class.

Instance Properties

  • [IVNFaceLandmarkRegion.PointCount]: The number of points in the face region.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion

type IVNFaceLandmarkRegion2D

type IVNFaceLandmarkRegion2D interface {
	IVNFaceLandmarkRegion

	// An enumeration that describes how to interpret the points the region provides.
	PointsClassification() VNPointsClassification

	// A buffer in memory containing normalized landmark points.
	NormalizedPoints() unsafe.Pointer
	// An array of precision estimates for each landmark point.
	PrecisionEstimatesPerPoint() []foundation.NSNumber
	// A buffer in memory containing landmark points in the coordinate space of the specified image size.
	PointsInImageOfSize(imageSize corefoundation.CGSize) corefoundation.CGPoint
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFaceLandmarkRegion2D class.

Describing Region Points

  • [IVNFaceLandmarkRegion2D.PointsClassification]: An enumeration that describes how to interpret the points the region provides.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D

type IVNFaceLandmarks

type IVNFaceLandmarks interface {
	objectivec.IObject
	VNRequestRevisionProviding

	// A confidence estimate for the detected landmarks.
	Confidence() VNConfidence

	// The facial features of the detected face.
	Landmarks() IVNFaceLandmarks2D
	SetLandmarks(value IVNFaceLandmarks2D)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFaceLandmarks class.

Determining Accuracy

  • [IVNFaceLandmarks.Confidence]: A confidence estimate for the detected landmarks.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks

type IVNFaceLandmarks2D

type IVNFaceLandmarks2D interface {
	IVNFaceLandmarks

	// The region containing all face landmark points.
	AllPoints() IVNFaceLandmarkRegion2D
	// The region containing points that trace the face contour from the left cheek, over the chin, to the right cheek.
	FaceContour() IVNFaceLandmarkRegion2D
	// The region containing points that outline the left eye.
	LeftEye() IVNFaceLandmarkRegion2D
	// The region containing points that outline the right eye.
	RightEye() IVNFaceLandmarkRegion2D
	// The region containing points that trace the left eyebrow.
	LeftEyebrow() IVNFaceLandmarkRegion2D
	// The region containing points that trace the right eyebrow.
	RightEyebrow() IVNFaceLandmarkRegion2D
	// The region containing points that outline the nose.
	Nose() IVNFaceLandmarkRegion2D
	// The region containing points that trace the center crest of the nose.
	NoseCrest() IVNFaceLandmarkRegion2D
	// The region containing points that trace a vertical line down the center of the face.
	MedianLine() IVNFaceLandmarkRegion2D
	// The region containing points that outline the outside of the lips.
	OuterLips() IVNFaceLandmarkRegion2D
	// The region containing points that outline the space between the lips.
	InnerLips() IVNFaceLandmarkRegion2D
	// The region containing the point where the left pupil is located.
	LeftPupil() IVNFaceLandmarkRegion2D
	// The region containing the point where the right pupil is located.
	RightPupil() IVNFaceLandmarkRegion2D

	// The bounding box of the object that the request detects.
	BoundingBox() corefoundation.CGRect
	SetBoundingBox(value corefoundation.CGRect)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFaceLandmarks2D class.

Face Landmark Points

  • [IVNFaceLandmarks2D.AllPoints]: The region containing all face landmark points.
  • [IVNFaceLandmarks2D.FaceContour]: The region containing points that trace the face contour from the left cheek, over the chin, to the right cheek.
  • [IVNFaceLandmarks2D.LeftEye]: The region containing points that outline the left eye.
  • [IVNFaceLandmarks2D.RightEye]: The region containing points that outline the right eye.
  • [IVNFaceLandmarks2D.LeftEyebrow]: The region containing points that trace the left eyebrow.
  • [IVNFaceLandmarks2D.RightEyebrow]: The region containing points that trace the right eyebrow.
  • [IVNFaceLandmarks2D.Nose]: The region containing points that outline the nose.
  • [IVNFaceLandmarks2D.NoseCrest]: The region containing points that trace the center crest of the nose.
  • [IVNFaceLandmarks2D.MedianLine]: The region containing points that trace a vertical line down the center of the face.
  • [IVNFaceLandmarks2D.OuterLips]: The region containing points that outline the outside of the lips.
  • [IVNFaceLandmarks2D.InnerLips]: The region containing points that outline the space between the lips.
  • [IVNFaceLandmarks2D.LeftPupil]: The region containing the point where the left pupil is located.
  • [IVNFaceLandmarks2D.RightPupil]: The region containing the point where the right pupil is located.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D

type IVNFaceObservation

type IVNFaceObservation interface {
	IVNDetectedObjectObservation

	// The facial features of the detected face.
	Landmarks() IVNFaceLandmarks2D

	// The roll angle of a face in radians.
	Roll() foundation.NSNumber
	// The yaw angle of a face in radians.
	Yaw() foundation.NSNumber
	// The pitch angle of a face in radians.
	Pitch() foundation.NSNumber

	// A value that indicates the quality of the face capture.
	FaceCaptureQuality() foundation.NSNumber
	// The results of the face-capture quality request.
	Results() IVNFaceObservation
	SetResults(value IVNFaceObservation)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFaceObservation class.

Identifying Landmarks

  • [IVNFaceObservation.Landmarks]: The facial features of the detected face.

Determining Facial Orientation

  • [IVNFaceObservation.Roll]: The roll angle of a face in radians.
  • [IVNFaceObservation.Yaw]: The yaw angle of a face in radians.
  • [IVNFaceObservation.Pitch]: The pitch angle of a face in radians.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation

type IVNFeaturePrintObservation

type IVNFeaturePrintObservation interface {
	IVNObservation

	// The feature print data.
	Data() foundation.INSData
	// The total number of elements in the data.
	ElementCount() uint

	// The type of each element in the data.
	ElementType() VNElementType

	// Computes the distance between two feature print observations.
	ComputeDistanceToFeaturePrintObservationError(featurePrint VNFeaturePrintObservation) (float32, error)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNFeaturePrintObservation class.

Fetching Feature Print Data

  • [IVNFeaturePrintObservation.Data]: The feature print data.
  • [IVNFeaturePrintObservation.ElementCount]: The total number of elements in the data.

Determining Types of Feature Prints

  • [IVNFeaturePrintObservation.ElementType]: The type of each element in the data.

Computing Distance Between Features

  • [IVNFeaturePrintObservation.ComputeDistanceToFeaturePrintObservationError]: Computes the distance between two feature print observations.

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation

type IVNGenerateAttentionBasedSaliencyImageRequest

type IVNGenerateAttentionBasedSaliencyImageRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 1 of the image saliency request.
	VNGenerateAttentionBasedSaliencyImageRequestRevision1() int
}

An interface definition for the VNGenerateAttentionBasedSaliencyImageRequest class.

Identifying Request Revisions

  • [IVNGenerateAttentionBasedSaliencyImageRequest.VNGenerateAttentionBasedSaliencyImageRequestRevision1]: A constant for specifying revision 1 of the image saliency request.

See: https://developer.apple.com/documentation/Vision/VNGenerateAttentionBasedSaliencyImageRequest

type IVNGenerateForegroundInstanceMaskRequest

type IVNGenerateForegroundInstanceMaskRequest interface {
	IVNImageBasedRequest

	// A constant for specifying the first revision of the foreground instance mask request.
	VNGenerateForegroundInstanceMaskRequestRevision1() int
}

An interface definition for the VNGenerateForegroundInstanceMaskRequest class.

See: https://developer.apple.com/documentation/Vision/VNGenerateForegroundInstanceMaskRequest

type IVNGenerateImageFeaturePrintRequest

type IVNGenerateImageFeaturePrintRequest interface {
	IVNImageBasedRequest

	// An optional setting that tells the algorithm how to scale an input image before generating the feature print.
	ImageCropAndScaleOption() VNImageCropAndScaleOption
	SetImageCropAndScaleOption(value VNImageCropAndScaleOption)

	// A constant for specifying the first revision of the feature-print request.
	VNGenerateImageFeaturePrintRequestRevision1() int
}

An interface definition for the VNGenerateImageFeaturePrintRequest class.

Scaling and Cropping Images

  • [IVNGenerateImageFeaturePrintRequest.ImageCropAndScaleOption]: An optional setting that tells the algorithm how to scale an input image before generating the feature print.
  • [IVNGenerateImageFeaturePrintRequest.SetImageCropAndScaleOption]

Identifying Request Revisions

  • [IVNGenerateImageFeaturePrintRequest.VNGenerateImageFeaturePrintRequestRevision1]: A constant for specifying the first revision of the feature-print request.

See: https://developer.apple.com/documentation/Vision/VNGenerateImageFeaturePrintRequest

type IVNGenerateObjectnessBasedSaliencyImageRequest

type IVNGenerateObjectnessBasedSaliencyImageRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 1 of the image saliency request.
	VNGenerateObjectnessBasedSaliencyImageRequestRevision1() int
}

An interface definition for the VNGenerateObjectnessBasedSaliencyImageRequest class.

Identifying Request Revisions

  • [IVNGenerateObjectnessBasedSaliencyImageRequest.VNGenerateObjectnessBasedSaliencyImageRequestRevision1]: A constant for specifying revision 1 of the image saliency request.

See: https://developer.apple.com/documentation/Vision/VNGenerateObjectnessBasedSaliencyImageRequest

type IVNGenerateOpticalFlowRequest

type IVNGenerateOpticalFlowRequest interface {
	IVNTargetedImageRequest

	// The accuracy level for computing optical flow.
	ComputationAccuracy() VNGenerateOpticalFlowRequestComputationAccuracy
	SetComputationAccuracy(value VNGenerateOpticalFlowRequestComputationAccuracy)
	// The output buffer’s pixel format.
	OutputPixelFormat() uint32
	SetOutputPixelFormat(value uint32)
	// A Boolean value that indicates whether to keep the raw pixel buffer coming from the machine learning network.
	KeepNetworkOutput() bool
	SetKeepNetworkOutput(value bool)

	// A constant for specifying revision 2 of the optical flow generation request.
	VNGenerateOpticalFlowRequestRevision2() int
	// A constant for specifying revision 1 of the optical flow generation request.
	VNGenerateOpticalFlowRequestRevision1() int
}

An interface definition for the VNGenerateOpticalFlowRequest class.

Configuring the Request

  • [IVNGenerateOpticalFlowRequest.ComputationAccuracy]: The accuracy level for computing optical flow.
  • [IVNGenerateOpticalFlowRequest.SetComputationAccuracy]
  • [IVNGenerateOpticalFlowRequest.OutputPixelFormat]: The output buffer’s pixel format.
  • [IVNGenerateOpticalFlowRequest.SetOutputPixelFormat]
  • [IVNGenerateOpticalFlowRequest.KeepNetworkOutput]: A Boolean value that indicates whether to keep the raw pixel buffer coming from the machine learning network.
  • [IVNGenerateOpticalFlowRequest.SetKeepNetworkOutput]

Identifying Request Revisions

  • [IVNGenerateOpticalFlowRequest.VNGenerateOpticalFlowRequestRevision2]: A constant for specifying revision 2 of the optical flow generation request.
  • [IVNGenerateOpticalFlowRequest.VNGenerateOpticalFlowRequestRevision1]: A constant for specifying revision 1 of the optical flow generation request.

See: https://developer.apple.com/documentation/Vision/VNGenerateOpticalFlowRequest

type IVNGeneratePersonInstanceMaskRequest

type IVNGeneratePersonInstanceMaskRequest interface {
	IVNImageBasedRequest

	// A constant for specifying revision 1 of the person instance mask request.
	VNGeneratePersonInstanceMaskRequestRevision1() int
}

An interface definition for the VNGeneratePersonInstanceMaskRequest class.

Identifying Request Revisions

  • [IVNGeneratePersonInstanceMaskRequest.VNGeneratePersonInstanceMaskRequestRevision1]: A constant for specifying revision 1 of the person instance mask request.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonInstanceMaskRequest

type IVNGeneratePersonSegmentationRequest

type IVNGeneratePersonSegmentationRequest interface {
	IVNStatefulRequest

	// The pixel format of the output image.
	OutputPixelFormat() uint32
	SetOutputPixelFormat(value uint32)
	// A value that indicates how the request balances accuracy and performance.
	QualityLevel() VNGeneratePersonSegmentationRequestQualityLevel
	SetQualityLevel(value VNGeneratePersonSegmentationRequestQualityLevel)

	// Returns a list of output pixel formats that the request supports.
	SupportedOutputPixelFormatsAndReturnError() ([]foundation.NSNumber, error)

	// A constant for specifying revision 1 of the person segmentation generation request.
	VNGeneratePersonSegmentationRequestRevision1() int
}

An interface definition for the VNGeneratePersonSegmentationRequest class.

Configuring the Request

  • [IVNGeneratePersonSegmentationRequest.OutputPixelFormat]: The pixel format of the output image.
  • [IVNGeneratePersonSegmentationRequest.SetOutputPixelFormat]
  • [IVNGeneratePersonSegmentationRequest.QualityLevel]: A value that indicates how the request balances accuracy and performance.
  • [IVNGeneratePersonSegmentationRequest.SetQualityLevel]

Getting the supported output pixel formats

  • [IVNGeneratePersonSegmentationRequest.SupportedOutputPixelFormatsAndReturnError]: Returns a list of output pixel formats that the request supports.

Identifying Request Revisions

  • [IVNGeneratePersonSegmentationRequest.VNGeneratePersonSegmentationRequestRevision1]: A constant for specifying revision 1 of the person segmentation generation request.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest

type IVNGeometryUtils

type IVNGeometryUtils interface {
	objectivec.IObject
}

An interface definition for the VNGeometryUtils class.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils

type IVNHomographicImageRegistrationRequest

type IVNHomographicImageRegistrationRequest interface {
	IVNImageRegistrationRequest

	// A constant for specifying revision 1 of the homographic image registration request.
	VNHomographicImageRegistrationRequestRevision1() int
}

An interface definition for the VNHomographicImageRegistrationRequest class.

Identifying Request Revisions

  • [IVNHomographicImageRegistrationRequest.VNHomographicImageRegistrationRequestRevision1]: A constant for specifying revision 1 of the homographic image registration request.

See: https://developer.apple.com/documentation/Vision/VNHomographicImageRegistrationRequest

type IVNHorizonObservation

type IVNHorizonObservation interface {
	IVNObservation

	// The angle of the observed horizon.
	Angle() float64
	// The transform to apply to the detected horizon.
	Transform() corefoundation.CGAffineTransform
	// Creates an affine transform for the specified image width and height.
	TransformForImageWidthHeight(width uintptr, height uintptr) corefoundation.CGAffineTransform

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHorizonObservation class.

Evaluating the Horizon

  • [IVNHorizonObservation.Angle]: The angle of the observed horizon.
  • [IVNHorizonObservation.Transform]: The transform to apply to the detected horizon.
  • [IVNHorizonObservation.TransformForImageWidthHeight]: Creates an affine transform for the specified image width and height.

See: https://developer.apple.com/documentation/Vision/VNHorizonObservation

type IVNHumanBodyPose3DObservation

type IVNHumanBodyPose3DObservation interface {
	IVNRecognizedPoints3DObservation

	// The names of the available joints in the observation.
	AvailableJointNames() []string
	// The available joint group names in the observation.
	AvailableJointsGroupNames() []string
	// Returns the point for a joint name that the observation recognizes.
	RecognizedPointForJointNameError(jointName VNHumanBodyPose3DObservationJointName) (IVNHumanBodyRecognizedPoint3D, error)
	// Returns a collection of points for the group name you specify.
	RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanBodyPose3DObservationJointsGroupName) (foundation.INSDictionary, error)

	// Returns a 2D point for the joint name you specify, relative to the input image.
	PointInImageForJointNameError(jointName VNHumanBodyPose3DObservationJointName) (IVNPoint, error)

	// Returns the parent joint of the joint name you specify.
	ParentJointNameForJointName(jointName VNHumanBodyPose3DObservationJointName) VNHumanBodyPose3DObservationJointName

	// The technique the framework uses to estimate body height.
	HeightEstimation() VNHumanBodyPose3DObservationHeightEstimation
	// The estimated human body height, in meters.
	BodyHeight() float32

	// A transform from the skeleton hip to the camera.
	CameraOriginMatrix() objectivec.IObject

	// Gets a position relative to the camera for the body joint you specify.
	GetCameraRelativePositionForJointNameError(modelPositionOut objectivec.IObject, jointName VNHumanBodyPose3DObservationJointName) (bool, error)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHumanBodyPose3DObservation class.

Accessing Points

  • [IVNHumanBodyPose3DObservation.AvailableJointNames]: The names of the available joints in the observation.
  • [IVNHumanBodyPose3DObservation.AvailableJointsGroupNames]: The available joint group names in the observation.
  • [IVNHumanBodyPose3DObservation.RecognizedPointForJointNameError]: Returns the point for a joint name that the observation recognizes.
  • [IVNHumanBodyPose3DObservation.RecognizedPointsForJointsGroupNameError]: Returns a collection of points for the group name you specify.

Getting the Joint Position

  • [IVNHumanBodyPose3DObservation.PointInImageForJointNameError]: Returns a 2D point for the joint name you specify, relative to the input image.

Getting the Parent Joint Name

  • [IVNHumanBodyPose3DObservation.ParentJointNameForJointName]: Returns the parent joint of the joint name you specify.

Getting the Body Height

  • [IVNHumanBodyPose3DObservation.HeightEstimation]: The technique the framework uses to estimate body height.
  • [IVNHumanBodyPose3DObservation.BodyHeight]: The estimated human body height, in meters.

Getting the Camera Position

  • [IVNHumanBodyPose3DObservation.CameraOriginMatrix]: A transform from the skeleton hip to the camera.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation

type IVNHumanBodyPoseObservation

type IVNHumanBodyPoseObservation interface {
	IVNRecognizedPointsObservation

	// The names of the available joints in the observation.
	AvailableJointNames() []string
	// The available joint group names in the observation.
	AvailableJointsGroupNames() []string
	// Retrieves the recognized point for a joint name.
	RecognizedPointForJointNameError(jointName VNHumanBodyPoseObservationJointName) (IVNRecognizedPoint, error)
	// Retrieves the recognized points associated with the joint group name.
	RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanBodyPoseObservationJointsGroupName) (foundation.INSDictionary, error)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHumanBodyPoseObservation class.

Accessing Points

  • [IVNHumanBodyPoseObservation.AvailableJointNames]: The names of the available joints in the observation.
  • [IVNHumanBodyPoseObservation.AvailableJointsGroupNames]: The available joint group names in the observation.
  • [IVNHumanBodyPoseObservation.RecognizedPointForJointNameError]: Retrieves the recognized point for a joint name.
  • [IVNHumanBodyPoseObservation.RecognizedPointsForJointsGroupNameError]: Retrieves the recognized points associated with the joint group name.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation

type IVNHumanBodyRecognizedPoint3D

type IVNHumanBodyRecognizedPoint3D interface {
	IVNRecognizedPoint3D

	// The three-dimensional position.
	LocalPosition() objectivec.IObject

	// The parent joint in the observation.
	ParentJoint() VNHumanBodyPose3DObservationJointName

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHumanBodyRecognizedPoint3D class.

Getting the Position

  • [IVNHumanBodyRecognizedPoint3D.LocalPosition]: The three-dimensional position.

Getting the Parent Joint

  • [IVNHumanBodyRecognizedPoint3D.ParentJoint]: The parent joint in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyRecognizedPoint3D

type IVNHumanHandPoseObservation

type IVNHumanHandPoseObservation interface {
	IVNRecognizedPointsObservation

	// The names of the available joints in the observation.
	AvailableJointNames() []string
	// The joint group names available in the observation.
	AvailableJointsGroupNames() []string
	// Retrieves the recognized point for a joint name.
	RecognizedPointForJointNameError(jointName VNHumanHandPoseObservationJointName) (IVNRecognizedPoint, error)
	// Retrieves the recognized points associated with the joint group name.
	RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanHandPoseObservationJointsGroupName) (foundation.INSDictionary, error)

	// The chirality, or handedness, of a pose.
	Chirality() VNChirality

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHumanHandPoseObservation class.

Retrieving Points

  • [IVNHumanHandPoseObservation.AvailableJointNames]: The names of the available joints in the observation.
  • [IVNHumanHandPoseObservation.AvailableJointsGroupNames]: The joint group names available in the observation.
  • [IVNHumanHandPoseObservation.RecognizedPointForJointNameError]: Retrieves the recognized point for a joint name.
  • [IVNHumanHandPoseObservation.RecognizedPointsForJointsGroupNameError]: Retrieves the recognized points associated with the joint group name.

Determining the Chirality

  • [IVNHumanHandPoseObservation.Chirality]: The chirality, or handedness, of a pose.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation

type IVNHumanObservation

type IVNHumanObservation interface {
	IVNDetectedObjectObservation

	// A Boolean value that indicates whether the observation represents an upper-body or full-body rectangle.
	UpperBodyOnly() bool

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNHumanObservation class.

Inspecting the Observation

  • [IVNHumanObservation.UpperBodyOnly]: A Boolean value that indicates whether the observation represents an upper-body or full-body rectangle.

See: https://developer.apple.com/documentation/Vision/VNHumanObservation

type IVNImageAestheticsScoresObservation

type IVNImageAestheticsScoresObservation interface {
	IVNObservation

	// A score which incorporates aesthetic score, failure score, and utility labels.
	OverallScore() float32
	// A Boolean value that represents images that are not necessarily of poor image quality, but may not have memorable or exciting content.
	IsUtility() bool

	// The results of the aesthetics request.
	Results() IVNImageAestheticsScoresObservation
	SetResults(value IVNImageAestheticsScoresObservation)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNImageAestheticsScoresObservation class.

Parsing Observation Content

  • [IVNImageAestheticsScoresObservation.OverallScore]: A score which incorporates aesthetic score, failure score, and utility labels.
  • [IVNImageAestheticsScoresObservation.IsUtility]: A Boolean value that represents images that are not necessarily of poor image quality, but may not have memorable or exciting content.

See: https://developer.apple.com/documentation/Vision/VNImageAestheticsScoresObservation

type IVNImageAlignmentObservation

type IVNImageAlignmentObservation interface {
	IVNObservation

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNImageAlignmentObservation class.

See: https://developer.apple.com/documentation/Vision/VNImageAlignmentObservation

type IVNImageBasedRequest

type IVNImageBasedRequest interface {
	IVNRequest

	// The region of the image in which Vision will perform the request.
	RegionOfInterest() corefoundation.CGRect
	SetRegionOfInterest(value corefoundation.CGRect)
}

An interface definition for the VNImageBasedRequest class.

Configuring a Request

  • [IVNImageBasedRequest.RegionOfInterest]: The region of the image in which Vision will perform the request.
  • [IVNImageBasedRequest.SetRegionOfInterest]

See: https://developer.apple.com/documentation/Vision/VNImageBasedRequest

type IVNImageHomographicAlignmentObservation

type IVNImageHomographicAlignmentObservation interface {
	IVNImageAlignmentObservation

	// The warp transform matrix to morph the floating image into the reference image.
	WarpTransform() objectivec.IObject

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNImageHomographicAlignmentObservation class.

Accessing the Transform

  • [IVNImageHomographicAlignmentObservation.WarpTransform]: The warp transform matrix to morph the floating image into the reference image.

See: https://developer.apple.com/documentation/Vision/VNImageHomographicAlignmentObservation

type IVNImageRegistrationRequest

type IVNImageRegistrationRequest interface {
	IVNTargetedImageRequest
}

An interface definition for the VNImageRegistrationRequest class.

See: https://developer.apple.com/documentation/Vision/VNImageRegistrationRequest

type IVNImageRequestHandler

type IVNImageRequestHandler interface {
	objectivec.IObject

	// Creates a handler to be used for performing requests on Core Graphics images.
	InitWithCGImageOptions(image coregraphics.CGImageRef, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to be used for performing requests on a Core Graphics image with known orientation.
	InitWithCGImageOrientationOptions(image coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to use for performing requests on Core Image image data.
	InitWithCIImageOptions(image objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to be used for performing requests on Core Image image data of a known orientation.
	InitWithCIImageOrientationOptions(image objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler for performing requests on a Core Video pixel buffer.
	InitWithCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler for performing requests on a Core Video pixel buffer of a known orientation.
	InitWithCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	InitWithCVPixelBufferDepthDataOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a request handler that performs requests on an image contained within a sample buffer.
	InitWithCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a request handler that performs requests on an image of a specified orientation contained within a sample buffer.
	InitWithCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a request handler that performs requests on an image in a sample buffer that contains depth data.
	InitWithCMSampleBufferDepthDataOrientationOptions(sampleBuffer objectivec.IObject, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to use for performing requests on an image in a data object.
	InitWithDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to use for performing requests on an image of known orientation.
	InitWithDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to be used for performing requests on an image at the specified URL.
	InitWithURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNImageRequestHandler
	// Creates a handler to be used for performing requests on an image with known orientation, at the specified URL.
	InitWithURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

	// Schedules Vision requests to perform.
	PerformRequestsError(requests []VNRequest) (bool, error)
}

An interface definition for the VNImageRequestHandler class.

Creating a Request Handler

  • [IVNImageRequestHandler.InitWithCGImageOptions]: Creates a handler to be used for performing requests on Core Graphics images.
  • [IVNImageRequestHandler.InitWithCGImageOrientationOptions]: Creates a handler to be used for performing requests on a Core Graphics image with known orientation.
  • [IVNImageRequestHandler.InitWithCIImageOptions]: Creates a handler to use for performing requests on Core Image image data.
  • [IVNImageRequestHandler.InitWithCIImageOrientationOptions]: Creates a handler to be used for performing requests on Core Image image data of a known orientation.
  • [IVNImageRequestHandler.InitWithCVPixelBufferOptions]: Creates a handler for performing requests on a Core Video pixel buffer.
  • [IVNImageRequestHandler.InitWithCVPixelBufferOrientationOptions]: Creates a handler for performing requests on a Core Video pixel buffer of a known orientation.
  • [IVNImageRequestHandler.InitWithCVPixelBufferDepthDataOrientationOptions]
  • [IVNImageRequestHandler.InitWithCMSampleBufferOptions]: Creates a request handler that performs requests on an image contained within a sample buffer.
  • [IVNImageRequestHandler.InitWithCMSampleBufferOrientationOptions]: Creates a request handler that performs requests on an image of a specified orientation contained within a sample buffer.
  • [IVNImageRequestHandler.InitWithCMSampleBufferDepthDataOrientationOptions]: Creates a request handler that performs requests on an image in a sample buffer that contains depth data.
  • [IVNImageRequestHandler.InitWithDataOptions]: Creates a handler to use for performing requests on an image in a data object.
  • [IVNImageRequestHandler.InitWithDataOrientationOptions]: Creates a handler to use for performing requests on an image of known orientation.
  • [IVNImageRequestHandler.InitWithURLOptions]: Creates a handler to be used for performing requests on an image at the specified URL.
  • [IVNImageRequestHandler.InitWithURLOrientationOptions]: Creates a handler to be used for performing requests on an image with known orientation, at the specified URL.

Executing a Request Handler

  • [IVNImageRequestHandler.PerformRequestsError]: Schedules Vision requests to perform.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler

type IVNImageTranslationAlignmentObservation

type IVNImageTranslationAlignmentObservation interface {
	IVNImageAlignmentObservation

	// The alignment transform to align the floating image with the reference image.
	AlignmentTransform() corefoundation.CGAffineTransform

	// A constant for specifying revision 1 of the translational image registration request.
	VNTranslationalImageRegistrationRequestRevision1() int

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNImageTranslationAlignmentObservation class.

Determining Alignment

  • [IVNImageTranslationAlignmentObservation.AlignmentTransform]: The alignment transform to align the floating image with the reference image.

Identifying Request Revisions

  • [IVNImageTranslationAlignmentObservation.VNTranslationalImageRegistrationRequestRevision1]: A constant for specifying revision 1 of the translational image registration request.

See: https://developer.apple.com/documentation/Vision/VNImageTranslationAlignmentObservation

type IVNInstanceMaskObservation

type IVNInstanceMaskObservation interface {
	IVNObservation

	// The collection that contains all instances, excluding the background.
	AllInstances() foundation.NSIndexSet
	// The resulting mask that represents all instances.
	InstanceMask() corevideo.CVImageBufferRef

	// Creates a low-resolution mask from the instances you specify.
	GenerateMaskForInstancesError(instances foundation.NSIndexSet) (corevideo.CVImageBufferRef, error)
	// Creates a high-resolution image where everything becomes transparent black, except for the instances you specify.
	GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError(instances foundation.NSIndexSet, requestHandler IVNImageRequestHandler, cropResult bool) (corevideo.CVImageBufferRef, error)
	// Creates a high-resolution mask where everything becomes transparent black, except for the instances you specify.
	GenerateScaledMaskForImageForInstancesFromRequestHandlerError(instances foundation.NSIndexSet, requestHandler IVNImageRequestHandler) (corevideo.CVImageBufferRef, error)

	// A constant for specifying the first revision of the foreground instance mask request.
	VNGenerateForegroundInstanceMaskRequestRevision1() int
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNInstanceMaskObservation class.

Accessing Instances

  • [IVNInstanceMaskObservation.AllInstances]: The collection that contains all instances, excluding the background.
  • [IVNInstanceMaskObservation.InstanceMask]: The resulting mask that represents all instances.

Creating a Mask

  • [IVNInstanceMaskObservation.GenerateMaskForInstancesError]: Creates a low-resolution mask from the instances you specify.
  • [IVNInstanceMaskObservation.GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError]: Creates a high-resolution image where everything becomes transparent black, except for the instances you specify.
  • [IVNInstanceMaskObservation.GenerateScaledMaskForImageForInstancesFromRequestHandlerError]: Creates a high-resolution mask where everything becomes transparent black, except for the instances you specify.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation

type IVNObservation

type IVNObservation interface {
	objectivec.IObject
	VNRequestRevisionProviding

	// A unique identifier assigned to the Vision observation.
	Uuid() foundation.NSUUID

	// The time range of the reported observation.
	TimeRange() objectivec.IObject
	// The level of confidence in the observation’s accuracy.
	Confidence() VNConfidence

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNObservation class.

Tracking Observations

  • [IVNObservation.Uuid]: A unique identifier assigned to the Vision observation.

Evaluating Observations

  • [IVNObservation.TimeRange]: The time range of the reported observation.
  • [IVNObservation.Confidence]: The level of confidence in the observation’s accuracy.

See: https://developer.apple.com/documentation/Vision/VNObservation

type IVNPixelBufferObservation

type IVNPixelBufferObservation interface {
	IVNObservation

	// The image that results from a request with image output.
	PixelBuffer() corevideo.CVImageBufferRef
	// A feature name that the CoreML model defines.
	FeatureName() string

	// Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.
	ModelDescription() coreml.MLModelDescription
	SetModelDescription(value coreml.MLModelDescription)
	// A dictionary of output feature descriptions, which the model keys by the output’s name.
	OutputDescriptionsByName() coreml.MLFeatureDescription
	SetOutputDescriptionsByName(value coreml.MLFeatureDescription)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNPixelBufferObservation class.

Parsing Observation Content

  • [IVNPixelBufferObservation.PixelBuffer]: The image that results from a request with image output.
  • [IVNPixelBufferObservation.FeatureName]: A feature name that the CoreML model defines.

See: https://developer.apple.com/documentation/Vision/VNPixelBufferObservation

type IVNPoint

type IVNPoint interface {
	objectivec.IObject

	// Creates a point object with the specified coordinates.
	InitWithXY(x float64, y float64) VNPoint
	// Creates a point object from the specified Core Graphics point.
	InitWithLocation(location corefoundation.CGPoint) VNPoint

	// The x-coordinate.
	X() float64
	// The y-coordinate.
	Y() float64
	// The Core Graphics point for this point.
	Location() corefoundation.CGPoint

	// Returns the distance to another point.
	DistanceToPoint(point IVNPoint) float64

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNPoint class.

Creating a Point

  • [IVNPoint.InitWithXY]: Creates a point object with the specified coordinates.
  • [IVNPoint.InitWithLocation]: Creates a point object from the specified Core Graphics point.

Inspecting a Point

  • [IVNPoint.X]: The x-coordinate.
  • [IVNPoint.Y]: The y-coordinate.
  • [IVNPoint.Location]: The Core Graphics point for this point.

Calculating Distance

  • [IVNPoint.DistanceToPoint]: Returns the distance to another point.

See: https://developer.apple.com/documentation/Vision/VNPoint

type IVNPoint3D

type IVNPoint3D interface {
	objectivec.IObject

	// Creates a point object with the position you specify.
	InitWithPosition(position objectivec.IObject) VNPoint3D

	// The three-dimensional position.
	Position() objectivec.IObject

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNPoint3D class.

Creating a Point

  • [IVNPoint3D.InitWithPosition]: Creates a point object with the position you specify.

Getting the Position

  • [IVNPoint3D.Position]: The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNPoint3D

type IVNRecognizeAnimalsRequest

type IVNRecognizeAnimalsRequest interface {
	IVNImageBasedRequest

	// Returns the identifiers of the animals that the request detects.
	SupportedIdentifiersAndReturnError() ([]string, error)

	// A constant for specifying revision 2 of the animal recognition request.
	VNRecognizeAnimalsRequestRevision2() int
	// A constant for specifying revision 1 of the animal recognition request.
	VNRecognizeAnimalsRequestRevision1() int
}

An interface definition for the VNRecognizeAnimalsRequest class.

Identifying Animals

  • [IVNRecognizeAnimalsRequest.SupportedIdentifiersAndReturnError]: Returns the identifiers of the animals that the request detects.

Identifying Request Revisions

  • [IVNRecognizeAnimalsRequest.VNRecognizeAnimalsRequestRevision2]: A constant for specifying revision 2 of the animal recognition request.
  • [IVNRecognizeAnimalsRequest.VNRecognizeAnimalsRequestRevision1]: A constant for specifying revision 1 of the animal recognition request.

See: https://developer.apple.com/documentation/Vision/VNRecognizeAnimalsRequest

type IVNRecognizeTextRequest

type IVNRecognizeTextRequest interface {
	IVNImageBasedRequest
	VNRequestProgressProviding

	// The minimum height, relative to the image height, of the text to recognize.
	MinimumTextHeight() float32
	SetMinimumTextHeight(value float32)
	// A value that determines whether the request prioritizes accuracy or speed in text recognition.
	RecognitionLevel() VNRequestTextRecognitionLevel
	SetRecognitionLevel(value VNRequestTextRecognitionLevel)

	// A Boolean value that indicates whether to attempt detecting the language to use the appropriate model for recognition and language correction.
	AutomaticallyDetectsLanguage() bool
	SetAutomaticallyDetectsLanguage(value bool)
	// An array of languages to detect, in priority order.
	RecognitionLanguages() []string
	SetRecognitionLanguages(value []string)
	// A Boolean value that indicates whether the request applies language correction during the recognition process.
	UsesLanguageCorrection() bool
	SetUsesLanguageCorrection(value bool)
	// An array of strings to supplement the recognized languages at the word-recognition stage.
	CustomWords() []string
	SetCustomWords(value []string)
	// Returns the identifiers of the languages that the request supports.
	SupportedRecognitionLanguagesAndReturnError() ([]string, error)

	// A constant for specifying revision 3 of the text recognition request.
	VNRecognizeTextRequestRevision3() int
	// A constant for specifying revision 2 of the text recognition request.
	VNRecognizeTextRequestRevision2() int
	// A constant for specifying revision 1 of the text recognition request.
	VNRecognizeTextRequestRevision1() int
}

An interface definition for the VNRecognizeTextRequest class.

Customizing Recognition Constraints

  • [IVNRecognizeTextRequest.MinimumTextHeight]: The minimum height, relative to the image height, of the text to recognize.
  • [IVNRecognizeTextRequest.SetMinimumTextHeight]
  • [IVNRecognizeTextRequest.RecognitionLevel]: A value that determines whether the request prioritizes accuracy or speed in text recognition.
  • [IVNRecognizeTextRequest.SetRecognitionLevel]

Specifying the Language

  • [IVNRecognizeTextRequest.AutomaticallyDetectsLanguage]: A Boolean value that indicates whether to attempt detecting the language to use the appropriate model for recognition and language correction.
  • [IVNRecognizeTextRequest.SetAutomaticallyDetectsLanguage]
  • [IVNRecognizeTextRequest.RecognitionLanguages]: An array of languages to detect, in priority order.
  • [IVNRecognizeTextRequest.SetRecognitionLanguages]
  • [IVNRecognizeTextRequest.UsesLanguageCorrection]: A Boolean value that indicates whether the request applies language correction during the recognition process.
  • [IVNRecognizeTextRequest.SetUsesLanguageCorrection]
  • [IVNRecognizeTextRequest.CustomWords]: An array of strings to supplement the recognized languages at the word-recognition stage.
  • [IVNRecognizeTextRequest.SetCustomWords]
  • [IVNRecognizeTextRequest.SupportedRecognitionLanguagesAndReturnError]: Returns the identifiers of the languages that the request supports.

Identifying Request Revisions

  • [IVNRecognizeTextRequest.VNRecognizeTextRequestRevision3]: A constant for specifying revision 3 of the text recognition request.
  • [IVNRecognizeTextRequest.VNRecognizeTextRequestRevision2]: A constant for specifying revision 2 of the text recognition request.
  • [IVNRecognizeTextRequest.VNRecognizeTextRequestRevision1]: A constant for specifying revision 1 of the text recognition request.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest

type IVNRecognizedObjectObservation

type IVNRecognizedObjectObservation interface {
	IVNDetectedObjectObservation

	// An array of observations that classify the recognized object.
	Labels() []VNClassificationObservation

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedObjectObservation class.

Classifying a Recognized Object

  • [IVNRecognizedObjectObservation.Labels]: An array of observations that classify the recognized object.

See: https://developer.apple.com/documentation/Vision/VNRecognizedObjectObservation

type IVNRecognizedPoint

type IVNRecognizedPoint interface {
	IVNDetectedPoint

	// The point’s identifier label.
	Identifier() VNRecognizedPointKey

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedPoint class.

Inspecting a Point

  • [IVNRecognizedPoint.Identifier]: The point’s identifier label.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint

type IVNRecognizedPoint3D

type IVNRecognizedPoint3D interface {
	IVNPoint3D

	// The identifier that provides context about what kind of point the request recognizes.
	Identifier() VNRecognizedPointKey

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedPoint3D class.

Getting the Identifier

  • [IVNRecognizedPoint3D.Identifier]: The identifier that provides context about what kind of point the request recognizes.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint3D

type IVNRecognizedPoints3DObservation

type IVNRecognizedPoints3DObservation interface {
	IVNObservation

	// The available point keys in the observation.
	AvailableKeys() []string
	// The available point group keys in the observation.
	AvailableGroupKeys() []string
	// Returns a point for a key you specify.
	RecognizedPointForKeyError(pointKey VNRecognizedPointKey) (IVNRecognizedPoint3D, error)
	// Returns a point for a group key you specify.
	RecognizedPointsForGroupKeyError(groupKey VNRecognizedPointGroupKey) (foundation.INSDictionary, error)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedPoints3DObservation class.

Inspecting the Observation

  • [IVNRecognizedPoints3DObservation.AvailableKeys]: The available point keys in the observation.
  • [IVNRecognizedPoints3DObservation.AvailableGroupKeys]: The available point group keys in the observation.
  • [IVNRecognizedPoints3DObservation.RecognizedPointForKeyError]: Returns a point for a key you specify.
  • [IVNRecognizedPoints3DObservation.RecognizedPointsForGroupKeyError]: Returns a point for a group key you specify.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation

type IVNRecognizedPointsObservation

type IVNRecognizedPointsObservation interface {
	IVNObservation

	// The available point keys in the observation.
	AvailableKeys() []string
	// The available point group keys in the observation.
	AvailableGroupKeys() []string
	// Retrieves a recognized point for a key.
	RecognizedPointForKeyError(pointKey VNRecognizedPointKey) (IVNRecognizedPoint, error)
	// Retrieves the recognized points for a key.
	RecognizedPointsForGroupKeyError(groupKey VNRecognizedPointGroupKey) (foundation.INSDictionary, error)

	// Retrieves the grouping of normalized point coordinates and confidence scores in a format compatible with Core ML.
	KeypointsMultiArrayAndReturnError() (coreml.MLMultiArray, error)

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedPointsObservation class.

Inspecting the Observation

  • [IVNRecognizedPointsObservation.AvailableKeys]: The available point keys in the observation.
  • [IVNRecognizedPointsObservation.AvailableGroupKeys]: The available point group keys in the observation.
  • [IVNRecognizedPointsObservation.RecognizedPointForKeyError]: Retrieves a recognized point for a key.
  • [IVNRecognizedPointsObservation.RecognizedPointsForGroupKeyError]: Retrieves the recognized points for a key.

Converting Points for Core ML

  • [IVNRecognizedPointsObservation.KeypointsMultiArrayAndReturnError]: Retrieves the grouping of normalized point coordinates and confidence scores in a format compatible with Core ML.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation

type IVNRecognizedText

type IVNRecognizedText interface {
	objectivec.IObject
	VNRequestRevisionProviding

	// The top candidate for recognized text.
	String() string
	// A normalized confidence score for the text recognition result.
	Confidence() VNConfidence

	// Calculates the bounding box around the characters in the range of a string.
	BoundingBoxForRangeError(range_ foundation.NSRange) (IVNRectangleObservation, error)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedText class.

Determining Recognized Text

  • [IVNRecognizedText.String]: The top candidate for recognized text.
  • [IVNRecognizedText.Confidence]: A normalized confidence score for the text recognition result.

See: https://developer.apple.com/documentation/Vision/VNRecognizedText

type IVNRecognizedTextObservation

type IVNRecognizedTextObservation interface {
	IVNRectangleObservation

	// Requests the  top candidates for a recognized text string.
	TopCandidates(maxCandidateCount uint) []VNRecognizedText

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRecognizedTextObservation class.

Obtaining Recognized Text

  • [IVNRecognizedTextObservation.TopCandidates]: Requests the top candidates for a recognized text string.

See: https://developer.apple.com/documentation/Vision/VNRecognizedTextObservation

type IVNRectangleObservation

type IVNRectangleObservation interface {
	IVNDetectedObjectObservation

	// The coordinates of the lower-left corner of the observation bounding box.
	BottomLeft() corefoundation.CGPoint
	// The coordinates of the lower-right corner of the observation bounding box.
	BottomRight() corefoundation.CGPoint
	// The coordinates of the upper-left corner of the observation bounding box.
	TopLeft() corefoundation.CGPoint
	// The coordinates of the upper-right corner of the observation bounding box.
	TopRight() corefoundation.CGPoint

	// The results of a document segmentation request.
	Results() IVNRectangleObservation
	SetResults(value IVNRectangleObservation)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNRectangleObservation class.

Accessing the Coordinates

  • [IVNRectangleObservation.BottomLeft]: The coordinates of the lower-left corner of the observation bounding box.
  • [IVNRectangleObservation.BottomRight]: The coordinates of the lower-right corner of the observation bounding box.
  • [IVNRectangleObservation.TopLeft]: The coordinates of the upper-left corner of the observation bounding box.
  • [IVNRectangleObservation.TopRight]: The coordinates of the upper-right corner of the observation bounding box.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation

type IVNRequest

type IVNRequest interface {
	objectivec.IObject

	// Creates a new Vision request with an optional completion handler.
	InitWithCompletionHandler(completionHandler ErrorHandler) VNRequest

	// The completion handler the system invokes after the request finishes processing.
	CompletionHandler() VNRequestCompletionHandler
	// A hint to minimize the resource burden of the request.
	PreferBackgroundProcessing() bool
	SetPreferBackgroundProcessing(value bool)
	// The collection of observation results generated by request processing.
	Results() []VNObservation
	// The specific algorithm or implementation revision that’s used to perform the request.
	Revision() uint
	SetRevision(value uint)
	// A Boolean signifying that the Vision request should execute exclusively on the CPU.
	UsesCPUOnly() bool
	SetUsesCPUOnly(value bool)

	// The collection of compute devices per stage that a request supports.
	SupportedComputeStageDevices() objectivec.IObject
	SetSupportedComputeStageDevices(value objectivec.IObject)

	// Cancels the request before it can finish executing.
	Cancel()

	// Returns the compute device for a compute stage.
	ComputeDeviceForComputeStage(computeStage VNComputeStage) coreml.MLComputeDeviceProtocol
	// Assigns a compute device for a compute stage.
	SetComputeDeviceForComputeStage(computeDevice coreml.MLComputeDeviceProtocol, computeStage VNComputeStage)
	// The collection of compute devices per stage that a request supports.
	SupportedComputeStageDevicesAndReturnError() (foundation.INSDictionary, error)
}

An interface definition for the VNRequest class.

Initializing a Request

  • [IVNRequest.InitWithCompletionHandler]: Creates a new Vision request with an optional completion handler.

Configuring a Request

  • [IVNRequest.CompletionHandler]: The completion handler the system invokes after the request finishes processing.
  • [IVNRequest.PreferBackgroundProcessing]: A hint to minimize the resource burden of the request.
  • [IVNRequest.SetPreferBackgroundProcessing]
  • [IVNRequest.Results]: The collection of observation results generated by request processing.
  • [IVNRequest.Revision]: The specific algorithm or implementation revision that’s used to perform the request.
  • [IVNRequest.SetRevision]
  • [IVNRequest.UsesCPUOnly]: A Boolean signifying that the Vision request should execute exclusively on the CPU.
  • [IVNRequest.SetUsesCPUOnly]

Configuring the Compute Device

  • [IVNRequest.SupportedComputeStageDevices]: The collection of compute devices per stage that a request supports.
  • [IVNRequest.SetSupportedComputeStageDevices]

Canceling a Request

  • [IVNRequest.Cancel]: Cancels the request before it can finish executing.

See: https://developer.apple.com/documentation/Vision/VNRequest

type IVNSaliencyImageObservation

type IVNSaliencyImageObservation interface {
	IVNPixelBufferObservation

	// A collection of objects describing the distinct areas of the saliency heat map.
	SalientObjects() []VNRectangleObservation

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNSaliencyImageObservation class.

Locating Salient Regions

  • [IVNSaliencyImageObservation.SalientObjects]: A collection of objects describing the distinct areas of the saliency heat map.

See: https://developer.apple.com/documentation/Vision/VNSaliencyImageObservation

type IVNSequenceRequestHandler

type IVNSequenceRequestHandler interface {
	objectivec.IObject

	// Schedules Vision requests to be performed on a Core Graphics image.
	PerformRequestsOnCGImageError(requests []VNRequest, image coregraphics.CGImageRef) (bool, error)
	// Schedules one or more Vision requests to be performed on a Core Graphics image with known orientation.
	PerformRequestsOnCGImageOrientationError(requests []VNRequest, image coregraphics.CGImageRef, orientation objectivec.IObject) (bool, error)
	// Schedules one or more Vision requests to be performed on Core Image image data.
	PerformRequestsOnCIImageError(requests []VNRequest, image objectivec.IObject) (bool, error)
	// Schedules one or more Vision requests to be performed on Core Image image data with known orientation.
	PerformRequestsOnCIImageOrientationError(requests []VNRequest, image objectivec.IObject, orientation objectivec.IObject) (bool, error)
	// Schedules one or more Vision requests to be performed on a Core Video pixel buffer.
	PerformRequestsOnCVPixelBufferError(requests []VNRequest, pixelBuffer corevideo.CVImageBufferRef) (bool, error)
	// Schedules one or more Vision requests to be performed on a Core Video pixel buffer with known orientation.
	PerformRequestsOnCVPixelBufferOrientationError(requests []VNRequest, pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject) (bool, error)
	// Performs one or more requests on an image contained within a sample buffer.
	PerformRequestsOnCMSampleBufferError(requests []VNRequest, sampleBuffer objectivec.IObject) (bool, error)
	// Performs one or more requests on an image of a specified orientation contained within a sample buffer.
	PerformRequestsOnCMSampleBufferOrientationError(requests []VNRequest, sampleBuffer objectivec.IObject, orientation objectivec.IObject) (bool, error)
	// Schedules one or more Vision requests to be performed on raw image data.
	PerformRequestsOnImageDataError(requests []VNRequest, imageData foundation.INSData) (bool, error)
	// Schedules one or more Vision requests to be performed on raw data containing an image with known orientation.
	PerformRequestsOnImageDataOrientationError(requests []VNRequest, imageData foundation.INSData, orientation objectivec.IObject) (bool, error)
	// Schedules one or more Vision requests to be performed on an image.
	PerformRequestsOnImageURLError(requests []VNRequest, imageURL foundation.INSURL) (bool, error)
	// Schedules one or more Vision requests to be performed on an image with known orientation, at a specific URL.
	PerformRequestsOnImageURLOrientationError(requests []VNRequest, imageURL foundation.INSURL, orientation objectivec.IObject) (bool, error)
}

An interface definition for the VNSequenceRequestHandler class.

Performing a Sequence Request

  • [IVNSequenceRequestHandler.PerformRequestsOnCGImageError]: Schedules Vision requests to be performed on a Core Graphics image.
  • [IVNSequenceRequestHandler.PerformRequestsOnCGImageOrientationError]: Schedules one or more Vision requests to be performed on a Core Graphics image with known orientation.
  • [IVNSequenceRequestHandler.PerformRequestsOnCIImageError]: Schedules one or more Vision requests to be performed on Core Image image data.
  • [IVNSequenceRequestHandler.PerformRequestsOnCIImageOrientationError]: Schedules one or more Vision requests to be performed on Core Image image data with known orientation.
  • [IVNSequenceRequestHandler.PerformRequestsOnCVPixelBufferError]: Schedules one or more Vision requests to be performed on a Core Video pixel buffer.
  • [IVNSequenceRequestHandler.PerformRequestsOnCVPixelBufferOrientationError]: Schedules one or more Vision requests to be performed on a Core Video pixel buffer with known orientation.
  • [IVNSequenceRequestHandler.PerformRequestsOnCMSampleBufferError]: Performs one or more requests on an image contained within a sample buffer.
  • [IVNSequenceRequestHandler.PerformRequestsOnCMSampleBufferOrientationError]: Performs one or more requests on an image of a specified orientation contained within a sample buffer.
  • [IVNSequenceRequestHandler.PerformRequestsOnImageDataError]: Schedules one or more Vision requests to be performed on raw image data.
  • [IVNSequenceRequestHandler.PerformRequestsOnImageDataOrientationError]: Schedules one or more Vision requests to be performed on raw data containing an image with known orientation.
  • [IVNSequenceRequestHandler.PerformRequestsOnImageURLError]: Schedules one or more Vision requests to be performed on an image.
  • [IVNSequenceRequestHandler.PerformRequestsOnImageURLOrientationError]: Schedules one or more Vision requests to be performed on an image with known orientation, at a specific URL.

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler

type IVNStatefulRequest

type IVNStatefulRequest interface {
	IVNImageBasedRequest

	// Initializes a video-based request.
	InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler ErrorHandler) VNStatefulRequest

	// The minimum number of frames a request processes before reporting an observation.
	MinimumLatencyFrameCount() int
	// A time value that indicates the interval between analysis operations.
	FrameAnalysisSpacing() objectivec.IObject
}

An interface definition for the VNStatefulRequest class.

Initializing a Request

  • [IVNStatefulRequest.InitWithFrameAnalysisSpacingCompletionHandler]: Initializes a video-based request.

Configuring the Request

  • [IVNStatefulRequest.MinimumLatencyFrameCount]: The minimum number of frames a request processes before reporting an observation.
  • [IVNStatefulRequest.FrameAnalysisSpacing]: A time value that indicates the interval between analysis operations.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest

type IVNTargetedImageRequest

type IVNTargetedImageRequest interface {
	IVNImageBasedRequest

	// Creates a new request targeting a Core Graphics image, executing the completion handler when done.
	InitWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.
	InitWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting a Core Image image.
	InitWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.
	InitWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting an image in a pixel buffer.
	InitWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting an image in a pixel buffer of known orientation.
	InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request with a completion handler that targets an image in a sample buffer.
	InitWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.
	InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting an image as raw data, executing the completion handler when done.
	InitWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.
	InitWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting an image at the specified URL, executing the completion handler when done.
	InitWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest
	// Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.
	InitWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

	// Creates a new request targeting a Core Graphics image.
	InitWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting a Core Graphics image of known orientation.
	InitWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting a Core Image image.
	InitWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request that targets an image in a sample buffer.
	InitWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting a Core Image image of known orientation.
	InitWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request that targets an image of a known orientation in a sample buffer.
	InitWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting an image in a pixel buffer of known orientation.
	InitWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting an image as raw data.
	InitWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting an image in a pixel buffer.
	InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting a raw data image of known orientation.
	InitWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting an image at the specified URL.
	InitWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNTargetedImageRequest
	// Creates a new request targeting an image of known orientation, at the specified URL.
	InitWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest
}

An interface definition for the VNTargetedImageRequest class.

Creating a Request

  • [IVNTargetedImageRequest.InitWithTargetedCGImageOptionsCompletionHandler]: Creates a new request targeting a Core Graphics image, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedCGImageOrientationOptionsCompletionHandler]: Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedCIImageOptionsCompletionHandler]: Creates a new request targeting a Core Image image.
  • [IVNTargetedImageRequest.InitWithTargetedCIImageOrientationOptionsCompletionHandler]: Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedCVPixelBufferOptionsCompletionHandler]: Creates a new request targeting an image in a pixel buffer.
  • [IVNTargetedImageRequest.InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler]: Creates a new request targeting an image in a pixel buffer of known orientation.
  • [IVNTargetedImageRequest.InitWithTargetedCMSampleBufferOptionsCompletionHandler]: Creates a new request with a completion handler that targets an image in a sample buffer.
  • [IVNTargetedImageRequest.InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler]: Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.
  • [IVNTargetedImageRequest.InitWithTargetedImageDataOptionsCompletionHandler]: Creates a new request targeting an image as raw data, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedImageDataOrientationOptionsCompletionHandler]: Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedImageURLOptionsCompletionHandler]: Creates a new request targeting an image at the specified URL, executing the completion handler when done.
  • [IVNTargetedImageRequest.InitWithTargetedImageURLOrientationOptionsCompletionHandler]: Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest

type IVNTextObservation

type IVNTextObservation interface {
	IVNRectangleObservation

	// An array of detected individual character bounding boxes.
	CharacterBoxes() []VNRectangleObservation

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNTextObservation class.

Finding Individual Characters

  • [IVNTextObservation.CharacterBoxes]: An array of detected individual character bounding boxes.

See: https://developer.apple.com/documentation/Vision/VNTextObservation

type IVNTrackObjectRequest

type IVNTrackObjectRequest interface {
	IVNTrackingRequest

	// Creates a new object tracking request with a detected object observation.
	InitWithDetectedObjectObservation(observation IVNDetectedObjectObservation) VNTrackObjectRequest
	// Creates a new object tracking request with a detected object observation.
	InitWithDetectedObjectObservationCompletionHandler(observation IVNDetectedObjectObservation, completionHandler ErrorHandler) VNTrackObjectRequest

	// A constant for specifying revision 2 of the object tracking request.
	VNTrackObjectRequestRevision2() int
	// A constant for specifying revision 1 of the object tracking request.
	VNTrackObjectRequestRevision1() int
}

An interface definition for the VNTrackObjectRequest class.

Initializing an Object Tracking Request

  • [IVNTrackObjectRequest.InitWithDetectedObjectObservation]: Creates a new object tracking request with a detected object observation.
  • [IVNTrackObjectRequest.InitWithDetectedObjectObservationCompletionHandler]: Creates a new object tracking request with a detected object observation.

Identifying Request Revisions

  • [IVNTrackObjectRequest.VNTrackObjectRequestRevision2]: A constant for specifying revision 2 of the object tracking request.
  • [IVNTrackObjectRequest.VNTrackObjectRequestRevision1]: A constant for specifying revision 1 of the object tracking request.

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest

type IVNTrackOpticalFlowRequest

type IVNTrackOpticalFlowRequest interface {
	IVNStatefulRequest

	// The level of accuracy to compute the optical flow.
	ComputationAccuracy() VNTrackOpticalFlowRequestComputationAccuracy
	SetComputationAccuracy(value VNTrackOpticalFlowRequestComputationAccuracy)
	// A Boolean value that indicates the raw pixel buffer continues to emit from the network.
	KeepNetworkOutput() bool
	SetKeepNetworkOutput(value bool)
	// The pixel format type of the output value.
	OutputPixelFormat() uint32
	SetOutputPixelFormat(value uint32)
}

An interface definition for the VNTrackOpticalFlowRequest class.

Configuring the Request

  • [IVNTrackOpticalFlowRequest.ComputationAccuracy]: The level of accuracy to compute the optical flow.
  • [IVNTrackOpticalFlowRequest.SetComputationAccuracy]
  • [IVNTrackOpticalFlowRequest.KeepNetworkOutput]: A Boolean value that indicates the raw pixel buffer continues to emit from the network.
  • [IVNTrackOpticalFlowRequest.SetKeepNetworkOutput]
  • [IVNTrackOpticalFlowRequest.OutputPixelFormat]: The pixel format type of the output value.
  • [IVNTrackOpticalFlowRequest.SetOutputPixelFormat]

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest

type IVNTrackRectangleRequest

type IVNTrackRectangleRequest interface {
	IVNTrackingRequest

	// Creates a new rectangle tracking request with a rectangle observation.
	InitWithRectangleObservation(observation IVNRectangleObservation) VNTrackRectangleRequest
	// Creates a new rectangle tracking request with a rectangle observation.
	InitWithRectangleObservationCompletionHandler(observation IVNRectangleObservation, completionHandler ErrorHandler) VNTrackRectangleRequest

	// A constant for specifying revision 1 of the rectangling tracking request.
	VNTrackRectangleRequestRevision1() int
}

An interface definition for the VNTrackRectangleRequest class.

Initializing a Rectangle Tracking Request

  • [IVNTrackRectangleRequest.InitWithRectangleObservation]: Creates a new rectangle tracking request with a rectangle observation.
  • [IVNTrackRectangleRequest.InitWithRectangleObservationCompletionHandler]: Creates a new rectangle tracking request with a rectangle observation.

Identifying Request Revisions

  • [IVNTrackRectangleRequest.VNTrackRectangleRequestRevision1]: A constant for specifying revision 1 of the rectangling tracking request.

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest

type IVNTrackingRequest

type IVNTrackingRequest interface {
	IVNImageBasedRequest

	// The observation object defining a region to track.
	InputObservation() IVNDetectedObjectObservation
	SetInputObservation(value IVNDetectedObjectObservation)
	// A value for specifying whether to prioritize speed or location accuracy.
	TrackingLevel() VNRequestTrackingLevel
	SetTrackingLevel(value VNRequestTrackingLevel)
	// A Boolean that indicates the last frame in a tracking sequence.
	LastFrame() bool
	SetLastFrame(value bool)

	// Returns the maximum number of simultaneous trackers for the request.
	SupportedNumberOfTrackersAndReturnError() (uint, error)
}

An interface definition for the VNTrackingRequest class.

Configuring a Tracking Request

  • [IVNTrackingRequest.InputObservation]: The observation object defining a region to track.
  • [IVNTrackingRequest.SetInputObservation]
  • [IVNTrackingRequest.TrackingLevel]: A value for specifying whether to prioritize speed or location accuracy.
  • [IVNTrackingRequest.SetTrackingLevel]
  • [IVNTrackingRequest.LastFrame]: A Boolean that indicates the last frame in a tracking sequence.
  • [IVNTrackingRequest.SetLastFrame]

Getting the Number of Trackers

  • [IVNTrackingRequest.SupportedNumberOfTrackersAndReturnError]: Returns the maximum number of simultaneous trackers for the request.

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest

type IVNTrajectoryObservation

type IVNTrajectoryObservation interface {
	IVNObservation

	// The centroid points of the detected contour along the trajectory.
	DetectedPoints() []VNPoint
	// The centroids of the calculated trajectory from the detected points.
	ProjectedPoints() []VNPoint
	// The coefficients of the parabolic equation.
	EquationCoefficients() objectivec.IObject
	// The moving average radius of the object the request is tracking.
	MovingAverageRadius() float64

	// The array of detected trajectory observations.
	Results() IVNTrajectoryObservation
	SetResults(value IVNTrajectoryObservation)
	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNTrajectoryObservation class.

Evaluating an Observation

  • [IVNTrajectoryObservation.DetectedPoints]: The centroid points of the detected contour along the trajectory.
  • [IVNTrajectoryObservation.ProjectedPoints]: The centroids of the calculated trajectory from the detected points.
  • [IVNTrajectoryObservation.EquationCoefficients]: The coefficients of the parabolic equation.
  • [IVNTrajectoryObservation.MovingAverageRadius]: The moving average radius of the object the request is tracking.

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation

type IVNVector

type IVNVector interface {
	objectivec.IObject

	// Creates a new vector in polar coordinate space.
	InitWithRTheta(r float64, theta float64) VNVector
	// Creates a new vector in Cartesian coordinate space.
	InitWithVectorHeadTail(head IVNPoint, tail IVNPoint) VNVector
	// Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections.
	InitWithXComponentYComponent(x float64, y float64) VNVector

	// The length, or absolute value, of the vector.
	Length() float64
	// The radius, absolute value, or length of the vector.
	R() float64
	// The angle between the vector direction and the positive direction of the x-axis.
	Theta() float64
	// The squared length of the vector.
	SquaredLength() float64
	// A signed projection that indicates the vector’s direction on the x-axis.
	X() float64
	// A signed projection that indicates the vector’s direction on the y-axis.
	Y() float64

	EncodeWithCoder(coder foundation.INSCoder)
}

An interface definition for the VNVector class.

Creating a Vector

  • [IVNVector.InitWithRTheta]: Creates a new vector in polar coordinate space.
  • [IVNVector.InitWithVectorHeadTail]: Creates a new vector in Cartesian coordinate space.
  • [IVNVector.InitWithXComponentYComponent]: Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections.

Inspecting a Vector

  • [IVNVector.Length]: The length, or absolute value, of the vector.
  • [IVNVector.R]: The radius, absolute value, or length of the vector.
  • [IVNVector.Theta]: The angle between the vector direction and the positive direction of the x-axis.
  • [IVNVector.SquaredLength]: The squared length of the vector.
  • [IVNVector.X]: A signed projection that indicates the vector’s direction on the x-axis.
  • [IVNVector.Y]: A signed projection that indicates the vector’s direction on the y-axis.

See: https://developer.apple.com/documentation/Vision/VNVector

type IVNVideoProcessor

type IVNVideoProcessor interface {
	objectivec.IObject

	// Creates a video processor to perform Vision requests against the specified video asset.
	InitWithURL(videoURL foundation.INSURL) VNVideoProcessor

	// Adds a request with processing options to the video processor.
	AddRequestProcessingOptionsError(request IVNRequest, processingOptions IVNVideoProcessorRequestProcessingOptions) (bool, error)
	// Removes a Vision request from the video processor’s request queue.
	RemoveRequestError(request IVNRequest) (bool, error)
	// Analyzes a time range of video content.
	AnalyzeTimeRangeError(timeRange objectivec.IObject) (bool, error)
	// Cancels the video processing.
	Cancel()
}

An interface definition for the VNVideoProcessor class.

Creating a Video Processor

  • [IVNVideoProcessor.InitWithURL]: Creates a video processor to perform Vision requests against the specified video asset.

Performing Requests

  • [IVNVideoProcessor.AddRequestProcessingOptionsError]: Adds a request with processing options to the video processor.
  • [IVNVideoProcessor.RemoveRequestError]: Removes a Vision request from the video processor’s request queue.
  • [IVNVideoProcessor.AnalyzeTimeRangeError]: Analyzes a time range of video content.
  • [IVNVideoProcessor.Cancel]: Cancels the video processing.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor

type IVNVideoProcessorCadence

type IVNVideoProcessorCadence interface {
	objectivec.IObject

	// The cadence the video processor maintains to process the request.
	Cadence() IVNVideoProcessorCadence
	SetCadence(value IVNVideoProcessorCadence)
}

An interface definition for the VNVideoProcessorCadence class.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/Cadence

type IVNVideoProcessorFrameRateCadence

type IVNVideoProcessorFrameRateCadence interface {
	IVNVideoProcessorCadence

	// Creates a new frame-based cadence with a frame rate.
	InitWithFrameRate(frameRate int) VNVideoProcessorFrameRateCadence

	// The frame rate at which to process video.
	FrameRate() int
}

An interface definition for the VNVideoProcessorFrameRateCadence class.

Creating a Cadence

  • [IVNVideoProcessorFrameRateCadence.InitWithFrameRate]: Creates a new frame-based cadence with a frame rate.

Inspecting the Frame Rate

  • [IVNVideoProcessorFrameRateCadence.FrameRate]: The frame rate at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/FrameRateCadence

type IVNVideoProcessorRequestProcessingOptions

type IVNVideoProcessorRequestProcessingOptions interface {
	objectivec.IObject

	// The cadence the video processor maintains to process the request.
	Cadence() IVNVideoProcessorCadence
	SetCadence(value IVNVideoProcessorCadence)
}

An interface definition for the VNVideoProcessorRequestProcessingOptions class.

Configuring Options

  • [IVNVideoProcessorRequestProcessingOptions.Cadence]: The cadence the video processor maintains to process the request.
  • [IVNVideoProcessorRequestProcessingOptions.SetCadence]

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/RequestProcessingOptions

type IVNVideoProcessorTimeIntervalCadence

type IVNVideoProcessorTimeIntervalCadence interface {
	IVNVideoProcessorCadence

	// Creates a new time-based cadence with a time interval.
	InitWithTimeInterval(timeInterval float64) VNVideoProcessorTimeIntervalCadence

	// The time interval of the cadence.
	TimeInterval() float64
}

An interface definition for the VNVideoProcessorTimeIntervalCadence class.

Creating a Cadence

  • [IVNVideoProcessorTimeIntervalCadence.InitWithTimeInterval]: Creates a new time-based cadence with a time interval.

Inspecting the Time Interval

  • [IVNVideoProcessorTimeIntervalCadence.TimeInterval]: The time interval of the cadence.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/TimeIntervalCadence

type VNAnimalBodyPoseObservation

type VNAnimalBodyPoseObservation struct {
	VNRecognizedPointsObservation
}

An observation that provides the animal body points the analysis recognizes.

Accessing Points

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation

func NewVNAnimalBodyPoseObservation

func NewVNAnimalBodyPoseObservation() VNAnimalBodyPoseObservation

NewVNAnimalBodyPoseObservation creates a new VNAnimalBodyPoseObservation instance.

func VNAnimalBodyPoseObservationFromID

func VNAnimalBodyPoseObservationFromID(id objc.ID) VNAnimalBodyPoseObservation

VNAnimalBodyPoseObservationFromID constructs a VNAnimalBodyPoseObservation from an objc.ID.

An observation that provides the animal body points the analysis recognizes.

func (VNAnimalBodyPoseObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNAnimalBodyPoseObservation) AvailableJointGroupNames

func (a VNAnimalBodyPoseObservation) AvailableJointGroupNames() []string

The available joint group names in the observation.

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation/availableJointGroupNames

func (VNAnimalBodyPoseObservation) AvailableJointNames

func (a VNAnimalBodyPoseObservation) AvailableJointNames() []string

The names of the available joints in the observation.

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation/availableJointNames

func (VNAnimalBodyPoseObservation) EncodeWithCoder

func (a VNAnimalBodyPoseObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNAnimalBodyPoseObservation) Init

Init initializes the instance.

func (VNAnimalBodyPoseObservation) RecognizedPointForJointNameError

func (a VNAnimalBodyPoseObservation) RecognizedPointForJointNameError(jointName VNAnimalBodyPoseObservationJointName) (IVNRecognizedPoint, error)

Returns the point for a joint name the observation recognizes.

jointName: The joint name to retrieve.

Return Value

The point for the joint name.

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation/recognizedPoint(_:)

func (VNAnimalBodyPoseObservation) RecognizedPointsForJointsGroupNameError

func (a VNAnimalBodyPoseObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName VNAnimalBodyPoseObservationJointsGroupName) (foundation.INSDictionary, error)

Returns the points for a joint group name the observation recognizes.

jointsGroupName: The joint group of the points to retrieve.

Return Value

The dictionary of points the observation associates with the group name.

See: https://developer.apple.com/documentation/Vision/VNAnimalBodyPoseObservation/recognizedPoints(_:)

type VNAnimalBodyPoseObservationClass

type VNAnimalBodyPoseObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNAnimalBodyPoseObservationClass

func GetVNAnimalBodyPoseObservationClass() VNAnimalBodyPoseObservationClass

GetVNAnimalBodyPoseObservationClass returns the class object for VNAnimalBodyPoseObservation.

func (VNAnimalBodyPoseObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNAnimalBodyPoseObservationJointName

type VNAnimalBodyPoseObservationJointName = string

type VNAnimalBodyPoseObservationJointNameValues

type VNAnimalBodyPoseObservationJointNameValues struct{}
var VNAnimalBodyPoseObservationJointNames VNAnimalBodyPoseObservationJointNameValues

VNAnimalBodyPoseObservationJointNames provides typed accessors for VNAnimalBodyPoseObservationJointName constants.

func (VNAnimalBodyPoseObservationJointNameValues) LeftBackElbow

LeftBackElbow returns A joint name that represents the back of the left elbow.

func (VNAnimalBodyPoseObservationJointNameValues) LeftBackKnee

LeftBackKnee returns A joint name that represents the back of the left knee.

func (VNAnimalBodyPoseObservationJointNameValues) LeftBackPaw

LeftBackPaw returns A joint name that represents the back of the left paw.

func (VNAnimalBodyPoseObservationJointNameValues) LeftEarBottom

LeftEarBottom returns A joint name that represents the bottom of the left ear.

func (VNAnimalBodyPoseObservationJointNameValues) LeftEarMiddle

LeftEarMiddle returns A joint name that represents the middle of the left ear.

func (VNAnimalBodyPoseObservationJointNameValues) LeftEarTop

LeftEarTop returns A joint name that represents the top of the left ear.

func (VNAnimalBodyPoseObservationJointNameValues) LeftEye

LeftEye returns A joint name that represents the left eye.

func (VNAnimalBodyPoseObservationJointNameValues) LeftFrontElbow

LeftFrontElbow returns A joint name that represents the front of the left elbow.

func (VNAnimalBodyPoseObservationJointNameValues) LeftFrontKnee

LeftFrontKnee returns A joint name that represents the front of the left knee.

func (VNAnimalBodyPoseObservationJointNameValues) LeftFrontPaw

LeftFrontPaw returns A joint name that represents the front of the left paw.

func (VNAnimalBodyPoseObservationJointNameValues) Neck

Neck returns A joint name that represents the neck.

func (VNAnimalBodyPoseObservationJointNameValues) Nose

Nose returns A joint name that represents the nose.

func (VNAnimalBodyPoseObservationJointNameValues) RightBackElbow

RightBackElbow returns A joint name that represents the back of the right elbow.

func (VNAnimalBodyPoseObservationJointNameValues) RightBackKnee

RightBackKnee returns A joint name that represents the back of the right knee.

func (VNAnimalBodyPoseObservationJointNameValues) RightBackPaw

RightBackPaw returns A joint name that represents the back of the right paw.

func (VNAnimalBodyPoseObservationJointNameValues) RightEarBottom

RightEarBottom returns A joint name that represents the bottom of the right ear.

func (VNAnimalBodyPoseObservationJointNameValues) RightEarMiddle

RightEarMiddle returns A joint name that represents the middle of the right ear.

func (VNAnimalBodyPoseObservationJointNameValues) RightEarTop

RightEarTop returns A joint name that represents the top of the right ear.

func (VNAnimalBodyPoseObservationJointNameValues) RightEye

RightEye returns A joint name that represents the right eye.

func (VNAnimalBodyPoseObservationJointNameValues) RightFrontElbow

RightFrontElbow returns A joint name that represents the front of the right elbow.

func (VNAnimalBodyPoseObservationJointNameValues) RightFrontKnee

RightFrontKnee returns A joint name that represents the front of the right knee.

func (VNAnimalBodyPoseObservationJointNameValues) RightFrontPaw

RightFrontPaw returns A joint name that represents the front of the right paw.

func (VNAnimalBodyPoseObservationJointNameValues) TailBottom

TailBottom returns A joint name that represents the bottom of the tail.

func (VNAnimalBodyPoseObservationJointNameValues) TailMiddle

TailMiddle returns A joint name that represents the middle of the tail.

func (VNAnimalBodyPoseObservationJointNameValues) TailTop

TailTop returns A joint name that represents the top of the tail.

type VNAnimalBodyPoseObservationJointsGroupName

type VNAnimalBodyPoseObservationJointsGroupName = string

type VNAnimalBodyPoseObservationJointsGroupNameValues

type VNAnimalBodyPoseObservationJointsGroupNameValues struct{}
var VNAnimalBodyPoseObservationJointsGroupNames VNAnimalBodyPoseObservationJointsGroupNameValues

VNAnimalBodyPoseObservationJointsGroupNames provides typed accessors for VNAnimalBodyPoseObservationJointsGroupName constants.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) All

All returns A group name that represents all joints.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) Forelegs

Forelegs returns A group name that represents the forelegs.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) Head

Head returns A group name that represents the head.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) Hindlegs

Hindlegs returns A group name that represents the hindlegs.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) Tail

Tail returns A group name that represents the tail.

func (VNAnimalBodyPoseObservationJointsGroupNameValues) Trunk

Trunk returns A group name that represents the trunk.

type VNAnimalIdentifier

type VNAnimalIdentifier = string

type VNAnimalIdentifierValues

type VNAnimalIdentifierValues struct{}
var VNAnimalIdentifiers VNAnimalIdentifierValues

VNAnimalIdentifiers provides typed accessors for VNAnimalIdentifier constants.

func (VNAnimalIdentifierValues) Cat

Cat returns An animal identifier for cats.

func (VNAnimalIdentifierValues) Dog

Dog returns An animal identifier for dogs.

type VNAspectRatio

type VNAspectRatio = float32

type VNBarcodeCompositeType

type VNBarcodeCompositeType int

See: https://developer.apple.com/documentation/Vision/VNBarcodeCompositeType

const (
	// VNBarcodeCompositeTypeGS1TypeA: A type that represents trade items in bulk.
	VNBarcodeCompositeTypeGS1TypeA VNBarcodeCompositeType = 2
	// VNBarcodeCompositeTypeGS1TypeB: A type that represents trade items by piece.
	VNBarcodeCompositeTypeGS1TypeB VNBarcodeCompositeType = 3
	// VNBarcodeCompositeTypeGS1TypeC: A type that represents trade items in varying quantity.
	VNBarcodeCompositeTypeGS1TypeC VNBarcodeCompositeType = 4
	// VNBarcodeCompositeTypeLinked: A type that represents a linked composite type.
	VNBarcodeCompositeTypeLinked VNBarcodeCompositeType = 1
	// VNBarcodeCompositeTypeNone: A type that represents no composite type.
	VNBarcodeCompositeTypeNone VNBarcodeCompositeType = 0
)

func (VNBarcodeCompositeType) String

func (e VNBarcodeCompositeType) String() string

type VNBarcodeObservation

type VNBarcodeObservation struct {
	VNRectangleObservation
}

An object that represents barcode information that an image analysis request detects.

Overview

This type of observation results from a VNDetectBarcodesRequest. It contains information about the detected barcode, including parsed payload data for supported symbologies.

Parsing the Payload

Reading Barcode Descriptors

Identifying Barcode Types

Identifying Barcode Colors

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation

func NewBarcodeObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight

func NewBarcodeObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight(requestRevision uint, topLeft corefoundation.CGPoint, bottomLeft corefoundation.CGPoint, bottomRight corefoundation.CGPoint, topRight corefoundation.CGPoint) VNBarcodeObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

bottomLeft: The lower-left corner point.

bottomRight: The lower-right corner point.

topRight: The upper-right corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:bottomLeft:bottomRight:topRight:)

func NewBarcodeObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft

func NewBarcodeObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft(requestRevision uint, topLeft corefoundation.CGPoint, topRight corefoundation.CGPoint, bottomRight corefoundation.CGPoint, bottomLeft corefoundation.CGPoint) VNBarcodeObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

topRight: The upper-right corner point.

bottomRight: The lower-right corner point.

bottomLeft: The lower-left corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:topRight:bottomRight:bottomLeft:)

func NewBarcodeObservationWithBoundingBox

func NewBarcodeObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNBarcodeObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewBarcodeObservationWithRequestRevisionBoundingBox

func NewBarcodeObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNBarcodeObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNBarcodeObservation

func NewVNBarcodeObservation() VNBarcodeObservation

NewVNBarcodeObservation creates a new VNBarcodeObservation instance.

func VNBarcodeObservationFromID

func VNBarcodeObservationFromID(id objc.ID) VNBarcodeObservation

VNBarcodeObservationFromID constructs a VNBarcodeObservation from an objc.ID.

An object that represents barcode information that an image analysis request detects.

func (VNBarcodeObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNBarcodeObservation) BarcodeDescriptor

func (b VNBarcodeObservation) BarcodeDescriptor() objectivec.IObject

An object that describes the low-level details about the barcode and its data.

Discussion

Use this object to have Core Image regenerate the observed barcode.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/barcodeDescriptor

func (VNBarcodeObservation) EncodeWithCoder

func (b VNBarcodeObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNBarcodeObservation) Init

Init initializes the instance.

func (VNBarcodeObservation) IsColorInverted

func (b VNBarcodeObservation) IsColorInverted() bool

A Boolean value that indicates whether the barcode is color inverted.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/isColorInverted

func (VNBarcodeObservation) IsGS1DataCarrier

func (b VNBarcodeObservation) IsGS1DataCarrier() bool

A Boolean value that indicates whether the barcode carries any global standards data.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/isGS1DataCarrier

func (VNBarcodeObservation) PayloadData

func (b VNBarcodeObservation) PayloadData() foundation.INSData

The raw data representation of the barcode’s payload.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/payloadData

func (VNBarcodeObservation) PayloadStringValue

func (b VNBarcodeObservation) PayloadStringValue() string

A string value that represents the barcode payload.

Discussion

Depending on the symbology or the payload data itself, a string representation of the payload may not be available.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/payloadStringValue

func (VNBarcodeObservation) SupplementalPayloadString

func (b VNBarcodeObservation) SupplementalPayloadString() string

The supplemental code decoded as a string value.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/supplementalPayloadString

func (VNBarcodeObservation) Symbology

The symbology of the observed barcode.

See: https://developer.apple.com/documentation/Vision/VNBarcodeObservation/symbology

type VNBarcodeObservationClass

type VNBarcodeObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNBarcodeObservationClass

func GetVNBarcodeObservationClass() VNBarcodeObservationClass

GetVNBarcodeObservationClass returns the class object for VNBarcodeObservation.

func (VNBarcodeObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNBarcodeSymbology

type VNBarcodeSymbology = string

type VNBarcodeSymbologyValues

type VNBarcodeSymbologyValues struct{}
var VNBarcodeSymbologys VNBarcodeSymbologyValues

VNBarcodeSymbologys provides typed accessors for VNBarcodeSymbology constants.

func (VNBarcodeSymbologyValues) Aztec

Aztec returns A constant that indicates Aztec symbology.

func (VNBarcodeSymbologyValues) Codabar

Codabar returns A constant that indicates Codabar symbology.

func (VNBarcodeSymbologyValues) Code39

Code39 returns A constant that indicates Code 39 symbology.

func (VNBarcodeSymbologyValues) Code39Checksum

Code39Checksum returns A constant that indicates Code 39 symbology with a checksum.

func (VNBarcodeSymbologyValues) Code39FullASCII

func (VNBarcodeSymbologyValues) Code39FullASCII() VNBarcodeSymbology

Code39FullASCII returns A constant that indicates Code 39 Full ASCII symbology.

func (VNBarcodeSymbologyValues) Code39FullASCIIChecksum

func (VNBarcodeSymbologyValues) Code39FullASCIIChecksum() VNBarcodeSymbology

Code39FullASCIIChecksum returns A constant that indicates Code 39 Full ASCII symbology with a checksum.

func (VNBarcodeSymbologyValues) Code93

Code93 returns A constant that indicates Code 93 symbology.

func (VNBarcodeSymbologyValues) Code93i

Code93i returns A constant that indicates Code 93i symbology.

func (VNBarcodeSymbologyValues) Code128

Code128 returns A constant that indicates Code 128 symbology.

func (VNBarcodeSymbologyValues) DataMatrix

DataMatrix returns A constant that indicates Data Matrix symbology.

func (VNBarcodeSymbologyValues) EAN8

EAN8 returns A constant that indicates EAN-8 symbology.

func (VNBarcodeSymbologyValues) EAN13

EAN13 returns A constant that indicates EAN-13 symbology.

func (VNBarcodeSymbologyValues) GS1DataBar

GS1DataBar returns A constant that indicates GS1 DataBar symbology.

func (VNBarcodeSymbologyValues) GS1DataBarExpanded

func (VNBarcodeSymbologyValues) GS1DataBarExpanded() VNBarcodeSymbology

GS1DataBarExpanded returns A constant that indicates GS1 DataBar Expanded symbology.

func (VNBarcodeSymbologyValues) GS1DataBarLimited

func (VNBarcodeSymbologyValues) GS1DataBarLimited() VNBarcodeSymbology

GS1DataBarLimited returns A constant that indicates GS1 DataBar Limited symbology.

func (VNBarcodeSymbologyValues) I2of5

I2of5 returns A constant that indicates Interleaved 2 of 5 (ITF) symbology.

func (VNBarcodeSymbologyValues) I2of5Checksum

I2of5Checksum returns A constant that indicates Interleaved 2 of 5 (ITF) symbology with a checksum.

func (VNBarcodeSymbologyValues) ITF14

ITF14 returns A constant that indicates ITF-14 symbology.

func (VNBarcodeSymbologyValues) MSIPlessey

MSIPlessey returns A constant that indicates Modified Plessey symbology.

func (VNBarcodeSymbologyValues) MicroPDF417

MicroPDF417 returns A constant that indicates MicroPDF417 symbology.

func (VNBarcodeSymbologyValues) MicroQR

MicroQR returns A constant that indicates MicroQR symbology.

func (VNBarcodeSymbologyValues) PDF417

PDF417 returns A constant that indicates PDF417 symbology.

func (VNBarcodeSymbologyValues) QR

QR returns A constant that indicates Quick Response (QR) symbology.

func (VNBarcodeSymbologyValues) UPCE

UPCE returns A constant that indicates UPC-E symbology.

type VNCalculateImageAestheticsScoresRequest

type VNCalculateImageAestheticsScoresRequest struct {
	VNImageBasedRequest
}

An object that analyzes an image for aesthetically pleasing attributes.

See: https://developer.apple.com/documentation/Vision/VNCalculateImageAestheticsScoresRequest

func NewCalculateImageAestheticsScoresRequestWithCompletionHandler

func NewCalculateImageAestheticsScoresRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNCalculateImageAestheticsScoresRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNCalculateImageAestheticsScoresRequest

func NewVNCalculateImageAestheticsScoresRequest() VNCalculateImageAestheticsScoresRequest

NewVNCalculateImageAestheticsScoresRequest creates a new VNCalculateImageAestheticsScoresRequest instance.

func VNCalculateImageAestheticsScoresRequestFromID

func VNCalculateImageAestheticsScoresRequestFromID(id objc.ID) VNCalculateImageAestheticsScoresRequest

VNCalculateImageAestheticsScoresRequestFromID constructs a VNCalculateImageAestheticsScoresRequest from an objc.ID.

An object that analyzes an image for aesthetically pleasing attributes.

func (VNCalculateImageAestheticsScoresRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNCalculateImageAestheticsScoresRequest) Init

Init initializes the instance.

type VNCalculateImageAestheticsScoresRequestClass

type VNCalculateImageAestheticsScoresRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNCalculateImageAestheticsScoresRequestClass

func GetVNCalculateImageAestheticsScoresRequestClass() VNCalculateImageAestheticsScoresRequestClass

GetVNCalculateImageAestheticsScoresRequestClass returns the class object for VNCalculateImageAestheticsScoresRequest.

func (VNCalculateImageAestheticsScoresRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNChirality

type VNChirality int

See: https://developer.apple.com/documentation/Vision/VNChirality

const (
	// VNChiralityLeft: Indicates a left-handed pose.
	VNChiralityLeft VNChirality = -1
	// VNChiralityRight: Indicates a right-handed pose.
	VNChiralityRight VNChirality = 1
	// VNChiralityUnknown: Indicates that the pose chirality is unknown.
	VNChiralityUnknown VNChirality = 0
)

func (VNChirality) String

func (e VNChirality) String() string

type VNCircle

type VNCircle struct {
	objectivec.Object
}

An immutable 2D circle represented by its center point and radius.

Creating a Circle

Inspecting a Circle

See: https://developer.apple.com/documentation/Vision/VNCircle

func NewCircleWithCenterDiameter

func NewCircleWithCenterDiameter(center IVNPoint, diameter float64) VNCircle

Creates a circle with the specified center and diameter.

center: The circle center.

diameter: The circle diameter.

See: https://developer.apple.com/documentation/Vision/VNCircle/init(center:diameter:)

func NewCircleWithCenterRadius

func NewCircleWithCenterRadius(center IVNPoint, radius float64) VNCircle

Creates a circle with the specified center and radius.

center: The circle center.

radius: The circle radius.

See: https://developer.apple.com/documentation/Vision/VNCircle/init(center:radius:)

func NewVNCircle

func NewVNCircle() VNCircle

NewVNCircle creates a new VNCircle instance.

func VNCircleFromID

func VNCircleFromID(id objc.ID) VNCircle

VNCircleFromID constructs a VNCircle from an objc.ID.

An immutable 2D circle represented by its center point and radius.

func (VNCircle) Autorelease

func (c VNCircle) Autorelease() VNCircle

Autorelease adds the receiver to the current autorelease pool.

func (VNCircle) Center

func (c VNCircle) Center() IVNPoint

The circle’s center point.

See: https://developer.apple.com/documentation/Vision/VNCircle/center

func (VNCircle) ContainsPoint

func (c VNCircle) ContainsPoint(point IVNPoint) bool

Determines if this circle, including its boundary, contains the specified point.

point: The point to test.

Return Value

true if the point is contained within this circle, otherwise false.

See: https://developer.apple.com/documentation/Vision/VNCircle/contains(_:)

func (VNCircle) ContainsPointInCircumferentialRingOfWidth

func (c VNCircle) ContainsPointInCircumferentialRingOfWidth(point IVNPoint, ringWidth float64) bool

Determines if a ring around this circle’s circumference contains the specified point.

point: The point to test.

ringWidth: The width of the ring around this circle’s circumference.

Return Value

true if the ring contains the specified point, otherwise false.

See: https://developer.apple.com/documentation/Vision/VNCircle/contains(_:inCircumferentialRingOfWidth:)

func (VNCircle) Diameter

func (c VNCircle) Diameter() float64

The circle’s diameter.

See: https://developer.apple.com/documentation/Vision/VNCircle/diameter

func (VNCircle) EncodeWithCoder

func (c VNCircle) EncodeWithCoder(coder foundation.INSCoder)

func (VNCircle) Init

func (c VNCircle) Init() VNCircle

Init initializes the instance.

func (VNCircle) InitWithCenterDiameter

func (c VNCircle) InitWithCenterDiameter(center IVNPoint, diameter float64) VNCircle

Creates a circle with the specified center and diameter.

center: The circle center.

diameter: The circle diameter.

See: https://developer.apple.com/documentation/Vision/VNCircle/init(center:diameter:)

func (VNCircle) InitWithCenterRadius

func (c VNCircle) InitWithCenterRadius(center IVNPoint, radius float64) VNCircle

Creates a circle with the specified center and radius.

center: The circle center.

radius: The circle radius.

See: https://developer.apple.com/documentation/Vision/VNCircle/init(center:radius:)

func (VNCircle) Radius

func (c VNCircle) Radius() float64

The circle’s radius.

See: https://developer.apple.com/documentation/Vision/VNCircle/radius

type VNCircleClass

type VNCircleClass struct {
	// contains filtered or unexported fields
}

func GetVNCircleClass

func GetVNCircleClass() VNCircleClass

GetVNCircleClass returns the class object for VNCircle.

func (VNCircleClass) Alloc

func (vc VNCircleClass) Alloc() VNCircle

Alloc allocates memory for a new instance of the class.

func (VNCircleClass) ZeroCircle

func (_VNCircleClass VNCircleClass) ZeroCircle() VNCircle

A circle object centered at the origin, with a radius of zero.

See: https://developer.apple.com/documentation/Vision/VNCircle/zero

type VNClassificationObservation

type VNClassificationObservation struct {
	VNObservation
}

An object that represents classification information that an image-analysis request produces.

Overview

This type of observation results from performing a VNCoreMLRequest image analysis with a Core ML model whose role is classification (rather than prediction or image-to-image processing). Vision infers that an MLModel object is a classifier model if that model predicts a single feature. That is, the model’s VNClassificationObservation.ModelDescription object has a non-`nil` value for its VNClassificationObservation.PredictedFeatureName property.

Determining Classification

Measuring Confidence and Precision

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation

func NewVNClassificationObservation

func NewVNClassificationObservation() VNClassificationObservation

NewVNClassificationObservation creates a new VNClassificationObservation instance.

func VNClassificationObservationFromID

func VNClassificationObservationFromID(id objc.ID) VNClassificationObservation

VNClassificationObservationFromID constructs a VNClassificationObservation from an objc.ID.

An object that represents classification information that an image-analysis request produces.

func (VNClassificationObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNClassificationObservation) EncodeWithCoder

func (c VNClassificationObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNClassificationObservation) HasMinimumPrecisionForRecall

func (c VNClassificationObservation) HasMinimumPrecisionForRecall(minimumPrecision float32, recall float32) bool

Determines whether the observation for a specific recall has a minimum precision value.

minimumPrecision: The minimum percentage of classification results that are relevant.

recall: The percentage of relevant results that the algorithm correctly classified.

Return Value

A Boolean indicating whether or not this classification observation provides a minimum percentage of relevant results that meet the desired recall criterion.

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation/hasMinimumPrecision(_:forRecall:)

func (VNClassificationObservation) HasMinimumRecallForPrecision

func (c VNClassificationObservation) HasMinimumRecallForPrecision(minimumRecall float32, precision float32) bool

Determines whether the observation for a specific precision has a minimum recall value.

minimumRecall: The minimum percentage of relevant results that the algorithm correctly classified.

precision: The percentage of classification results that are relevant.

Return Value

A Boolean indicating whether or not this classification observation provides a minimum percentage of relevant results that meet the desired precision criterion.

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation/hasMinimumRecall(_:forPrecision:)

func (VNClassificationObservation) HasPrecisionRecallCurve

func (c VNClassificationObservation) HasPrecisionRecallCurve() bool

A Boolean variable indicating whether the observation contains precision and recall curves.

Discussion

Precision refers to the percentage of your classification results that are relevant, while recall refers to the percentage of total relevant results correctly classified.

If this property is true, then you can call precision and recall-related methods in this observation. If this property is false, then the precision and recall-related methods won’t return meaningful data.

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation/hasPrecisionRecallCurve

func (VNClassificationObservation) Identifier

func (c VNClassificationObservation) Identifier() string

Classification label identifying the type of observation.

Discussion

An example classification could be a string like `cat` or `hotdog`. The model used for the classification defines the domain of strings that may result. Usually, these strings are unlocalized technical labels not meant for direct presentation to the end user.

See: https://developer.apple.com/documentation/Vision/VNClassificationObservation/identifier

func (VNClassificationObservation) Init

Init initializes the instance.

func (VNClassificationObservation) ModelDescription

Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.

See: https://developer.apple.com/documentation/CoreML/MLModel/modelDescription

func (VNClassificationObservation) PredictedFeatureName

func (c VNClassificationObservation) PredictedFeatureName() string

The name of the primary prediction feature output description.

See: https://developer.apple.com/documentation/CoreML/MLModelDescription/predictedFeatureName

func (VNClassificationObservation) SetModelDescription

func (c VNClassificationObservation) SetModelDescription(value coreml.MLModelDescription)

func (VNClassificationObservation) SetPredictedFeatureName

func (c VNClassificationObservation) SetPredictedFeatureName(value string)

type VNClassificationObservationClass

type VNClassificationObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNClassificationObservationClass

func GetVNClassificationObservationClass() VNClassificationObservationClass

GetVNClassificationObservationClass returns the class object for VNClassificationObservation.

func (VNClassificationObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNClassifyImageRequest

type VNClassifyImageRequest struct {
	VNImageBasedRequest
}

A request to classify an image.

Overview

This type of request produces a collection of VNClassificationObservation objects that describe an image. Access the classifications through knownClassifications(forRevision:).

Accessing Results

Specifying Algorithm Revision

See: https://developer.apple.com/documentation/Vision/VNClassifyImageRequest

func NewClassifyImageRequestWithCompletionHandler

func NewClassifyImageRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNClassifyImageRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNClassifyImageRequest

func NewVNClassifyImageRequest() VNClassifyImageRequest

NewVNClassifyImageRequest creates a new VNClassifyImageRequest instance.

func VNClassifyImageRequestFromID

func VNClassifyImageRequestFromID(id objc.ID) VNClassifyImageRequest

VNClassifyImageRequestFromID constructs a VNClassifyImageRequest from an objc.ID.

A request to classify an image.

func (VNClassifyImageRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNClassifyImageRequest) Init

Init initializes the instance.

func (VNClassifyImageRequest) SupportedIdentifiersAndReturnError

func (c VNClassifyImageRequest) SupportedIdentifiersAndReturnError() ([]string, error)

Returns the classification identifiers that the request supports in its current configuration.

Return Value

An array of supported identifiers.

See: https://developer.apple.com/documentation/Vision/VNClassifyImageRequest/supportedIdentifiers()

func (VNClassifyImageRequest) VNClassifyImageRequestRevision1

func (c VNClassifyImageRequest) VNClassifyImageRequestRevision1() int

A constant for specifying the first revision of the image-classification request.

See: https://developer.apple.com/documentation/vision/vnclassifyimagerequestrevision1

type VNClassifyImageRequestClass

type VNClassifyImageRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNClassifyImageRequestClass

func GetVNClassifyImageRequestClass() VNClassifyImageRequestClass

GetVNClassifyImageRequestClass returns the class object for VNClassifyImageRequest.

func (VNClassifyImageRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNComputeStage

type VNComputeStage = string

type VNComputeStageValues

type VNComputeStageValues struct{}
var VNComputeStages VNComputeStageValues

VNComputeStages provides typed accessors for VNComputeStage constants.

func (VNComputeStageValues) Main

Main returns A stage that represents where the system performs the main functionality.

func (VNComputeStageValues) PostProcessing

func (VNComputeStageValues) PostProcessing() VNComputeStage

PostProcessing returns A stage that represents where the system performs additional analysis from the main compute stage.

type VNConfidence

type VNConfidence = float32

type VNContour

type VNContour struct {
	objectivec.Object
}

A class that represents a detected contour in an image.

Inspecting the Contour

Accessing Child Contours

See: https://developer.apple.com/documentation/Vision/VNContour

func NewVNContour

func NewVNContour() VNContour

NewVNContour creates a new VNContour instance.

func VNContourFromID

func VNContourFromID(id objc.ID) VNContour

VNContourFromID constructs a VNContour from an objc.ID.

A class that represents a detected contour in an image.

func (VNContour) AspectRatio

func (c VNContour) AspectRatio() float32

The aspect ratio of the contour.

Discussion

The aspect ratio is the original image’s width divided by its height.

See: https://developer.apple.com/documentation/Vision/VNContour/aspectRatio

func (VNContour) Autorelease

func (c VNContour) Autorelease() VNContour

Autorelease adds the receiver to the current autorelease pool.

func (VNContour) ChildContourAtIndexError

func (c VNContour) ChildContourAtIndexError(childContourIndex uint) (IVNContour, error)

Retrieves the child contour object at the specified index.

childContourIndex: The child contour index value.

Return Value

The child contour object.

See: https://developer.apple.com/documentation/Vision/VNContour/childContour(at:)

func (VNContour) ChildContourCount

func (c VNContour) ChildContourCount() int

The total number of detected child contours.

See: https://developer.apple.com/documentation/Vision/VNContour/childContourCount

func (VNContour) ChildContours

func (c VNContour) ChildContours() []VNContour

An array of contours that this contour encloses.

See: https://developer.apple.com/documentation/Vision/VNContour/childContours

func (VNContour) ContourCount

func (c VNContour) ContourCount() int

The total number of detected contours.

See: https://developer.apple.com/documentation/vision/vncontoursobservation/contourcount

func (VNContour) IndexPath

func (c VNContour) IndexPath() objc.ID

The contour object’s index path.

See: https://developer.apple.com/documentation/Vision/VNContour/indexPath

func (VNContour) Init

func (c VNContour) Init() VNContour

Init initializes the instance.

func (VNContour) NormalizedPath

func (c VNContour) NormalizedPath() coregraphics.CGPathRef

The contour object as a path in normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNContour/normalizedPath

func (VNContour) NormalizedPoints

func (c VNContour) NormalizedPoints() objectivec.IObject

The contour’s array of points in normalized coordinates.

Discussion

This property value provides the address of the buffer that contains the array of CGPoint values.

See: https://developer.apple.com/documentation/Vision/VNContour/normalizedPoints-2orqj

func (VNContour) PointCount

func (c VNContour) PointCount() int

The contour’s number of points.

See: https://developer.apple.com/documentation/Vision/VNContour/pointCount

func (VNContour) PolygonApproximationWithEpsilonError

func (c VNContour) PolygonApproximationWithEpsilonError(epsilon float32) (IVNContour, error)

Simplifies the contour to a polygon using a Ramer-Douglas-Peucker algorithm.

epsilon: This parameter defines the distance threshold the algorithm uses. It preserves points whose perpendicular distance to the line segment they are on is greater than `epsilon`, and removes all others.

Return Value

A simplified polygon contour from the points of the original contour.

See: https://developer.apple.com/documentation/Vision/VNContour/polygonApproximation(epsilon:)

func (VNContour) RequestRevision

func (c VNContour) RequestRevision() uint

The revision of the VNRequest subclass used to generate the implementing object.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision

func (VNContour) SetContourCount

func (c VNContour) SetContourCount(value int)

func (VNContour) SetTopLevelContourCount

func (c VNContour) SetTopLevelContourCount(value int)

func (VNContour) SetTopLevelContours

func (c VNContour) SetTopLevelContours(value IVNContour)

func (VNContour) TopLevelContourCount

func (c VNContour) TopLevelContourCount() int

The total number of detected top-level contours.

See: https://developer.apple.com/documentation/vision/vncontoursobservation/toplevelcontourcount

func (VNContour) TopLevelContours

func (c VNContour) TopLevelContours() IVNContour

An array of contours that don’t have another contour enclosing them.

See: https://developer.apple.com/documentation/vision/vncontoursobservation/toplevelcontours

type VNContourClass

type VNContourClass struct {
	// contains filtered or unexported fields
}

func GetVNContourClass

func GetVNContourClass() VNContourClass

GetVNContourClass returns the class object for VNContour.

func (VNContourClass) Alloc

func (vc VNContourClass) Alloc() VNContour

Alloc allocates memory for a new instance of the class.

type VNContoursObservation

type VNContoursObservation struct {
	VNObservation
}

An object that represents the detected contours in an image.

Inspecting the Observation

See: https://developer.apple.com/documentation/Vision/VNContoursObservation

func NewVNContoursObservation

func NewVNContoursObservation() VNContoursObservation

NewVNContoursObservation creates a new VNContoursObservation instance.

func VNContoursObservationFromID

func VNContoursObservationFromID(id objc.ID) VNContoursObservation

VNContoursObservationFromID constructs a VNContoursObservation from an objc.ID.

An object that represents the detected contours in an image.

func (VNContoursObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNContoursObservation) ContourAtIndexError

func (c VNContoursObservation) ContourAtIndexError(contourIndex int) (IVNContour, error)

Retrieves the contour object at the specified index, irrespective of hierarchy.

contourIndex: The index of the contour to retrieve. Valid values are in the range of 0 to [ContourCount] - 1.

Return Value

The contour object at the specified index.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/contour(at:)-9on0y

func (VNContoursObservation) ContourAtIndexPathError

func (c VNContoursObservation) ContourAtIndexPathError(indexPath objectivec.IObject) (IVNContour, error)

Retrieves the contour object at the specified index path.

indexPath: The hierarchical index path to the contour.

Return Value

The contour object at the specified index path.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/contour(at:)-52odo

func (VNContoursObservation) ContourCount

func (c VNContoursObservation) ContourCount() int

The total number of detected contours.

Discussion

Use this value to determine the number of indices available for calling [ContourAtIndexError].

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/contourCount

func (VNContoursObservation) EncodeWithCoder

func (c VNContoursObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNContoursObservation) Init

Init initializes the instance.

func (VNContoursObservation) NormalizedPath

func (c VNContoursObservation) NormalizedPath() coregraphics.CGPathRef

The detected contours as a path object in normalized coordinates.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/normalizedPath

func (VNContoursObservation) Results

The results of the request to detect contours.

See: https://developer.apple.com/documentation/vision/vndetectcontoursrequest/results

func (VNContoursObservation) SetResults

func (c VNContoursObservation) SetResults(value IVNContoursObservation)

func (VNContoursObservation) TopLevelContourCount

func (c VNContoursObservation) TopLevelContourCount() int

The total number of detected top-level contours.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/topLevelContourCount

func (VNContoursObservation) TopLevelContours

func (c VNContoursObservation) TopLevelContours() []VNContour

An array of contours that don’t have another contour enclosing them.

Discussion

This array constitutes the top of the contour hierarchy. You can iterate over each VNContour instance to determine its children.

See: https://developer.apple.com/documentation/Vision/VNContoursObservation/topLevelContours

type VNContoursObservationClass

type VNContoursObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNContoursObservationClass

func GetVNContoursObservationClass() VNContoursObservationClass

GetVNContoursObservationClass returns the class object for VNContoursObservation.

func (VNContoursObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNCoreMLFeatureValueObservation

type VNCoreMLFeatureValueObservation struct {
	VNObservation
}

An object that represents a collection of key-value information that a Core ML image-analysis request produces.

Overview

This type of observation results from performing a VNCoreMLRequest image analysis with a Core ML model whose role is prediction rather than classification or image-to-image processing.

Vision infers that an MLModel object is a predictor model if that model predicts multiple features. You can tell that a model predicts multiple features when its VNCoreMLFeatureValueObservation.ModelDescription object has a `nil` value for its VNCoreMLFeatureValueObservation.PredictedFeatureName property, or when it inserts its output in an VNCoreMLFeatureValueObservation.OutputDescriptionsByName dictionary.

Obtaining Feature Values

See: https://developer.apple.com/documentation/Vision/VNCoreMLFeatureValueObservation

func NewVNCoreMLFeatureValueObservation

func NewVNCoreMLFeatureValueObservation() VNCoreMLFeatureValueObservation

NewVNCoreMLFeatureValueObservation creates a new VNCoreMLFeatureValueObservation instance.

func VNCoreMLFeatureValueObservationFromID

func VNCoreMLFeatureValueObservationFromID(id objc.ID) VNCoreMLFeatureValueObservation

VNCoreMLFeatureValueObservationFromID constructs a VNCoreMLFeatureValueObservation from an objc.ID.

An object that represents a collection of key-value information that a Core ML image-analysis request produces.

func (VNCoreMLFeatureValueObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNCoreMLFeatureValueObservation) EncodeWithCoder

func (c VNCoreMLFeatureValueObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNCoreMLFeatureValueObservation) FeatureName

func (c VNCoreMLFeatureValueObservation) FeatureName() string

The name used in the model description of the CoreML model that produced this observation.

See: https://developer.apple.com/documentation/Vision/VNCoreMLFeatureValueObservation/featureName

func (VNCoreMLFeatureValueObservation) FeatureValue

The feature result of a VNCoreMLRequest that outputs neither a classification nor an image.

Discussion

Refer to Core ML documentation and the model itself to learn about proper handling of the content.

See: https://developer.apple.com/documentation/Vision/VNCoreMLFeatureValueObservation/featureValue

func (VNCoreMLFeatureValueObservation) Init

Init initializes the instance.

func (VNCoreMLFeatureValueObservation) ModelDescription

Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.

See: https://developer.apple.com/documentation/CoreML/MLModel/modelDescription

func (VNCoreMLFeatureValueObservation) OutputDescriptionsByName

func (c VNCoreMLFeatureValueObservation) OutputDescriptionsByName() coreml.MLFeatureDescription

A dictionary of output feature descriptions, which the model keys by the output’s name.

See: https://developer.apple.com/documentation/CoreML/MLModelDescription/outputDescriptionsByName

func (VNCoreMLFeatureValueObservation) PredictedFeatureName

func (c VNCoreMLFeatureValueObservation) PredictedFeatureName() string

The name of the primary prediction feature output description.

See: https://developer.apple.com/documentation/CoreML/MLModelDescription/predictedFeatureName

func (VNCoreMLFeatureValueObservation) SetModelDescription

func (c VNCoreMLFeatureValueObservation) SetModelDescription(value coreml.MLModelDescription)

func (VNCoreMLFeatureValueObservation) SetOutputDescriptionsByName

func (c VNCoreMLFeatureValueObservation) SetOutputDescriptionsByName(value coreml.MLFeatureDescription)

func (VNCoreMLFeatureValueObservation) SetPredictedFeatureName

func (c VNCoreMLFeatureValueObservation) SetPredictedFeatureName(value string)

type VNCoreMLFeatureValueObservationClass

type VNCoreMLFeatureValueObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNCoreMLFeatureValueObservationClass

func GetVNCoreMLFeatureValueObservationClass() VNCoreMLFeatureValueObservationClass

GetVNCoreMLFeatureValueObservationClass returns the class object for VNCoreMLFeatureValueObservation.

func (VNCoreMLFeatureValueObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNCoreMLModel

type VNCoreMLModel struct {
	objectivec.Object
}

A container for the model to use with Vision requests.

Overview

A Core ML model encapsulates the information trained from a data set used to drive Vision recognition requests. See Getting a Core ML Model for instructions on training your own model. Once you train the model, use this class to initialize a VNCoreMLRequest for identification.

Providing Features

See: https://developer.apple.com/documentation/Vision/VNCoreMLModel

func NewCoreMLModelForMLModelError

func NewCoreMLModelForMLModelError(model coreml.MLModel) (VNCoreMLModel, error)

Creates a model container to use with a Core ML request.

model: The model to create the model container from.

Discussion

This method may fail if the framework doesn’t support the Core ML model. For example, a model that doesn’t accept an image as any of its inputs will yield an [ErrorInvalidModel] error.

See: https://developer.apple.com/documentation/Vision/VNCoreMLModel/init(for:)

func NewVNCoreMLModel

func NewVNCoreMLModel() VNCoreMLModel

NewVNCoreMLModel creates a new VNCoreMLModel instance.

func VNCoreMLModelFromID

func VNCoreMLModelFromID(id objc.ID) VNCoreMLModel

VNCoreMLModelFromID constructs a VNCoreMLModel from an objc.ID.

A container for the model to use with Vision requests.

func (VNCoreMLModel) Autorelease

func (c VNCoreMLModel) Autorelease() VNCoreMLModel

Autorelease adds the receiver to the current autorelease pool.

func (VNCoreMLModel) FeatureProvider

func (c VNCoreMLModel) FeatureProvider() coreml.MLFeatureProvider

An optional object to support inputs outside Vision.

Discussion

This optional object conforms to the MLFeatureProvider protocol that the model uses to predict inputs that are not supplied by Vision. Vision provides the MLModel with the image for the [InputImageFeatureName] via the [VNRequestHandler].

A feature provider is necessary for models that have more than one required input. Models with only one image input won’t use the feature provider.

See: https://developer.apple.com/documentation/Vision/VNCoreMLModel/featureProvider

func (VNCoreMLModel) Init

func (c VNCoreMLModel) Init() VNCoreMLModel

Init initializes the instance.

func (VNCoreMLModel) InputImageFeatureName

func (c VNCoreMLModel) InputImageFeatureName() string

The name of the feature value that Vision sets from the request handler.

Discussion

By default, Vision uses the first input found, but you can manually set that input to another [FeatureName] instead.

See: https://developer.apple.com/documentation/Vision/VNCoreMLModel/inputImageFeatureName

func (VNCoreMLModel) Model

func (c VNCoreMLModel) Model() IVNCoreMLModel

The model to base the image analysis request on.

See: https://developer.apple.com/documentation/vision/vncoremlrequest/model

func (VNCoreMLModel) SetFeatureProvider

func (c VNCoreMLModel) SetFeatureProvider(value coreml.MLFeatureProvider)

func (VNCoreMLModel) SetInputImageFeatureName

func (c VNCoreMLModel) SetInputImageFeatureName(value string)

func (VNCoreMLModel) SetModel

func (c VNCoreMLModel) SetModel(value IVNCoreMLModel)

type VNCoreMLModelClass

type VNCoreMLModelClass struct {
	// contains filtered or unexported fields
}

func GetVNCoreMLModelClass

func GetVNCoreMLModelClass() VNCoreMLModelClass

GetVNCoreMLModelClass returns the class object for VNCoreMLModel.

func (VNCoreMLModelClass) Alloc

func (vc VNCoreMLModelClass) Alloc() VNCoreMLModel

Alloc allocates memory for a new instance of the class.

type VNCoreMLRequest

type VNCoreMLRequest struct {
	VNImageBasedRequest
}

An image-analysis request that uses a Core ML model to process images.

Overview

The results array of a Core ML-based image analysis request contains a different observation type, depending on the kind of MLModel object you use:

- If the model predicts a single feature, the model’s VNCoreMLRequest.ModelDescription object has a non-`nil` value for VNCoreMLRequest.PredictedFeatureName and Vision treats the model as a classifier. The results are VNClassificationObservation objects. - If the model’s outputs include at least one output with a feature type of MLFeatureType.image, Vision treats that model as an image-to-image model. The results are VNPixelBufferObservation objects. - Otherwise, Vision treats the model as a general predictor model. The results are VNCoreMLFeatureValueObservation objects.

Initializing with a Core ML Model

Configuring Image Options

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest

func NewCoreMLRequestWithCompletionHandler

func NewCoreMLRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNCoreMLRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewCoreMLRequestWithModel

func NewCoreMLRequestWithModel(model IVNCoreMLModel) VNCoreMLRequest

Creates a model container to use with an image analysis request based on the model you provide.

model: The Core ML model on which to base the Vision request. // Core ML: https://developer.apple.com/documentation/CoreML

Discussion

Initialization can fail if the Core ML model you provide isn’t supported in Vision, such as if the model doesn’t accept an image as input.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/init(model:)

func NewCoreMLRequestWithModelCompletionHandler

func NewCoreMLRequestWithModelCompletionHandler(model IVNCoreMLModel, completionHandler VNRequestCompletionHandler) VNCoreMLRequest

Creates a model container to use with an image analysis request based on the model you provide, with an optional completion handler.

model: The Core ML model on which to base the Vision request. // Core ML: https://developer.apple.com/documentation/CoreML

completionHandler: An optional block of code to execute after model initialization.

Discussion

Initialization can fail if the Core ML model you provide isn’t supported in Vision, such as if the model doesn’t accept an image as input.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/init(model:completionHandler:)

func NewVNCoreMLRequest

func NewVNCoreMLRequest() VNCoreMLRequest

NewVNCoreMLRequest creates a new VNCoreMLRequest instance.

func VNCoreMLRequestFromID

func VNCoreMLRequestFromID(id objc.ID) VNCoreMLRequest

VNCoreMLRequestFromID constructs a VNCoreMLRequest from an objc.ID.

An image-analysis request that uses a Core ML model to process images.

func (VNCoreMLRequest) Autorelease

func (c VNCoreMLRequest) Autorelease() VNCoreMLRequest

Autorelease adds the receiver to the current autorelease pool.

func (VNCoreMLRequest) Confidence

func (c VNCoreMLRequest) Confidence() VNConfidence

The level of confidence in the observation’s accuracy.

See: https://developer.apple.com/documentation/vision/vnobservation/confidence

func (VNCoreMLRequest) ImageCropAndScaleOption

func (c VNCoreMLRequest) ImageCropAndScaleOption() VNImageCropAndScaleOption

An optional setting that tells the Vision algorithm how to scale an input image.

Discussion

Scaling an image ensures that the entire image fits into the algorithm’s input image dimensions, which may require a change in aspect ratio. Each crop-and-scale option transforms the input image in a different way.

[scale-crop-options]

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/imageCropAndScaleOption

func (VNCoreMLRequest) Init

Init initializes the instance.

func (VNCoreMLRequest) InitWithModel

func (c VNCoreMLRequest) InitWithModel(model IVNCoreMLModel) VNCoreMLRequest

Creates a model container to use with an image analysis request based on the model you provide.

model: The Core ML model on which to base the Vision request. // Core ML: https://developer.apple.com/documentation/CoreML

Discussion

Initialization can fail if the Core ML model you provide isn’t supported in Vision, such as if the model doesn’t accept an image as input.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/init(model:)

func (VNCoreMLRequest) InitWithModelCompletionHandler

func (c VNCoreMLRequest) InitWithModelCompletionHandler(model IVNCoreMLModel, completionHandler ErrorHandler) VNCoreMLRequest

Creates a model container to use with an image analysis request based on the model you provide, with an optional completion handler.

model: The Core ML model on which to base the Vision request. // Core ML: https://developer.apple.com/documentation/CoreML

completionHandler: An optional block of code to execute after model initialization.

Discussion

Initialization can fail if the Core ML model you provide isn’t supported in Vision, such as if the model doesn’t accept an image as input.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/init(model:completionHandler:)

func (VNCoreMLRequest) Model

func (c VNCoreMLRequest) Model() IVNCoreMLModel

The model to base the image analysis request on.

Discussion

This object wraps a Core ML model.

See: https://developer.apple.com/documentation/Vision/VNCoreMLRequest/model

func (VNCoreMLRequest) ModelDescription

func (c VNCoreMLRequest) ModelDescription() coreml.MLModelDescription

Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.

See: https://developer.apple.com/documentation/CoreML/MLModel/modelDescription

func (VNCoreMLRequest) PredictedFeatureName

func (c VNCoreMLRequest) PredictedFeatureName() string

The name of the primary prediction feature output description.

See: https://developer.apple.com/documentation/CoreML/MLModelDescription/predictedFeatureName

func (VNCoreMLRequest) SetConfidence

func (c VNCoreMLRequest) SetConfidence(value VNConfidence)

func (VNCoreMLRequest) SetImageCropAndScaleOption

func (c VNCoreMLRequest) SetImageCropAndScaleOption(value VNImageCropAndScaleOption)

func (VNCoreMLRequest) SetModelDescription

func (c VNCoreMLRequest) SetModelDescription(value coreml.MLModelDescription)

func (VNCoreMLRequest) SetPredictedFeatureName

func (c VNCoreMLRequest) SetPredictedFeatureName(value string)

func (VNCoreMLRequest) VNCoreMLRequestRevision1

func (c VNCoreMLRequest) VNCoreMLRequestRevision1() int

A constant for specifying revision 1 of a Core ML request.

See: https://developer.apple.com/documentation/vision/vncoremlrequestrevision1

type VNCoreMLRequestClass

type VNCoreMLRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNCoreMLRequestClass

func GetVNCoreMLRequestClass() VNCoreMLRequestClass

GetVNCoreMLRequestClass returns the class object for VNCoreMLRequest.

func (VNCoreMLRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDegrees

type VNDegrees = float32

type VNDetectAnimalBodyPoseRequest

type VNDetectAnimalBodyPoseRequest struct {
	VNImageBasedRequest
}

A request that detects an animal body pose.

Determining Supported Joints

See: https://developer.apple.com/documentation/Vision/VNDetectAnimalBodyPoseRequest

func NewDetectAnimalBodyPoseRequestWithCompletionHandler

func NewDetectAnimalBodyPoseRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectAnimalBodyPoseRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectAnimalBodyPoseRequest

func NewVNDetectAnimalBodyPoseRequest() VNDetectAnimalBodyPoseRequest

NewVNDetectAnimalBodyPoseRequest creates a new VNDetectAnimalBodyPoseRequest instance.

func VNDetectAnimalBodyPoseRequestFromID

func VNDetectAnimalBodyPoseRequestFromID(id objc.ID) VNDetectAnimalBodyPoseRequest

VNDetectAnimalBodyPoseRequestFromID constructs a VNDetectAnimalBodyPoseRequest from an objc.ID.

A request that detects an animal body pose.

func (VNDetectAnimalBodyPoseRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectAnimalBodyPoseRequest) Init

Init initializes the instance.

func (VNDetectAnimalBodyPoseRequest) SetSupportedJointNames

func (VNDetectAnimalBodyPoseRequest) SetSupportedJointsGroupNames

func (d VNDetectAnimalBodyPoseRequest) SetSupportedJointsGroupNames(value VNAnimalBodyPoseObservationJointsGroupName)

func (VNDetectAnimalBodyPoseRequest) SupportedJointNames

Retrieves the joint names the request supports.

See: https://developer.apple.com/documentation/vision/vndetectanimalbodyposerequest/supportedjointnames

func (VNDetectAnimalBodyPoseRequest) SupportedJointNamesAndReturnError

func (d VNDetectAnimalBodyPoseRequest) SupportedJointNamesAndReturnError() ([]string, error)

Retrieves the joint names the request supports.

error: If an error occurs, an object that describes the error; otherwise, `nil`.

Return Value

The array of joint names.

See: https://developer.apple.com/documentation/Vision/VNDetectAnimalBodyPoseRequest/supportedJointNamesAndReturnError:

func (VNDetectAnimalBodyPoseRequest) SupportedJointsGroupNames

Retrieves the joint group names the request supports.

See: https://developer.apple.com/documentation/vision/vndetectanimalbodyposerequest/supportedjointsgroupnames

func (VNDetectAnimalBodyPoseRequest) SupportedJointsGroupNamesAndReturnError

func (d VNDetectAnimalBodyPoseRequest) SupportedJointsGroupNamesAndReturnError() ([]string, error)

Retrieves the joint group names the request supports.

error: If an error occurs, an object that describes the error; otherwise, `nil`.

Return Value

The array of joint group names.

See: https://developer.apple.com/documentation/Vision/VNDetectAnimalBodyPoseRequest/supportedJointsGroupNamesAndReturnError:

type VNDetectAnimalBodyPoseRequestClass

type VNDetectAnimalBodyPoseRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectAnimalBodyPoseRequestClass

func GetVNDetectAnimalBodyPoseRequestClass() VNDetectAnimalBodyPoseRequestClass

GetVNDetectAnimalBodyPoseRequestClass returns the class object for VNDetectAnimalBodyPoseRequest.

func (VNDetectAnimalBodyPoseRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectBarcodesRequest

type VNDetectBarcodesRequest struct {
	VNImageBasedRequest
}

A request that detects barcodes in an image.

Overview

This request returns an array of VNBarcodeObservation objects, one for each barcode it detects.

Specifying Symbologies

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectBarcodesRequest

func NewDetectBarcodesRequestWithCompletionHandler

func NewDetectBarcodesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectBarcodesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectBarcodesRequest

func NewVNDetectBarcodesRequest() VNDetectBarcodesRequest

NewVNDetectBarcodesRequest creates a new VNDetectBarcodesRequest instance.

func VNDetectBarcodesRequestFromID

func VNDetectBarcodesRequestFromID(id objc.ID) VNDetectBarcodesRequest

VNDetectBarcodesRequestFromID constructs a VNDetectBarcodesRequest from an objc.ID.

A request that detects barcodes in an image.

func (VNDetectBarcodesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectBarcodesRequest) CoalesceCompositeSymbologies

func (d VNDetectBarcodesRequest) CoalesceCompositeSymbologies() bool

A Boolean value that indicates whether to coalesce multiple codes based on the symbology.

See: https://developer.apple.com/documentation/Vision/VNDetectBarcodesRequest/coalesceCompositeSymbologies

func (VNDetectBarcodesRequest) Init

Init initializes the instance.

func (VNDetectBarcodesRequest) SetCoalesceCompositeSymbologies

func (d VNDetectBarcodesRequest) SetCoalesceCompositeSymbologies(value bool)

func (VNDetectBarcodesRequest) SetSymbologies

func (d VNDetectBarcodesRequest) SetSymbologies(value []string)

func (VNDetectBarcodesRequest) SupportedSymbologiesAndReturnError

func (d VNDetectBarcodesRequest) SupportedSymbologiesAndReturnError() ([]string, error)

Returns the barcode symbologies that the request supports.

Return Value

An array of symbologies.

See: https://developer.apple.com/documentation/Vision/VNDetectBarcodesRequest/supportedSymbologies()

func (VNDetectBarcodesRequest) Symbologies

func (d VNDetectBarcodesRequest) Symbologies() []string

The barcode symbologies that the request detects in an image.

Discussion

By default, a request scans for all symbologies. Specify a subset of symbologies to limit the request’s detection range.

See: https://developer.apple.com/documentation/Vision/VNDetectBarcodesRequest/symbologies

func (VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision1

func (d VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision1() int

A constant for specifying revision 1 of the barcode detection request.

See: https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision1

func (VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision2

func (d VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision2() int

A constant for specifying revision 2 of the barcode detection request.

See: https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision2

func (VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision3

func (d VNDetectBarcodesRequest) VNDetectBarcodesRequestRevision3() int

A constant for specifying revision 3 of the barcode detection request.

See: https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision3

type VNDetectBarcodesRequestClass

type VNDetectBarcodesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectBarcodesRequestClass

func GetVNDetectBarcodesRequestClass() VNDetectBarcodesRequestClass

GetVNDetectBarcodesRequestClass returns the class object for VNDetectBarcodesRequest.

func (VNDetectBarcodesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectContoursRequest

type VNDetectContoursRequest struct {
	VNImageBasedRequest
}

A request that detects the contours of the edges of an image.

Configuring the Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest

func NewDetectContoursRequestWithCompletionHandler

func NewDetectContoursRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectContoursRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectContoursRequest

func NewVNDetectContoursRequest() VNDetectContoursRequest

NewVNDetectContoursRequest creates a new VNDetectContoursRequest instance.

func VNDetectContoursRequestFromID

func VNDetectContoursRequestFromID(id objc.ID) VNDetectContoursRequest

VNDetectContoursRequestFromID constructs a VNDetectContoursRequest from an objc.ID.

A request that detects the contours of the edges of an image.

func (VNDetectContoursRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectContoursRequest) ContrastAdjustment

func (d VNDetectContoursRequest) ContrastAdjustment() float32

The amount by which to adjust the image contrast.

Discussion

Contour detection works best with high-contrast images. The default value of this property is `2.0`, which doubles the image contrast to achieve the most accurate results.

This property supports a value range from `0.0` to `3.0`.

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest/contrastAdjustment

func (VNDetectContoursRequest) ContrastPivot

func (d VNDetectContoursRequest) ContrastPivot() foundation.NSNumber

The pixel value to use as a pivot for the contrast.

Discussion

Numeric values range from `0.0` to `1.0`. You can also specify `nil` to have the framework automatically detect the value according to image intensity.

The default value is `0.5`, which indicates the pixel center.

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest/contrastPivot

func (VNDetectContoursRequest) DetectsDarkOnLight

func (d VNDetectContoursRequest) DetectsDarkOnLight() bool

A Boolean value that indicates whether the request detects a dark object on a light background to aid in detection.

Discussion

The default value is true.

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest/detectsDarkOnLight

func (VNDetectContoursRequest) Init

Init initializes the instance.

func (VNDetectContoursRequest) MaximumImageDimension

func (d VNDetectContoursRequest) MaximumImageDimension() uint

The maximum image dimension to use for contour detection.

Discussion

Contour detection is computationally intensive. To improve performance, Vision scales the input image down, while maintaining its aspect ratio, such that its maximum dimension is the value of this property. Vision never scales the image up, so specifying the maximum value ensures that the image processes in its original size and not as a downscaled version.

This property supports values from 64 to NSUIntegerMax. The default value is 512.

See: https://developer.apple.com/documentation/Vision/VNDetectContoursRequest/maximumImageDimension

func (VNDetectContoursRequest) SetContrastAdjustment

func (d VNDetectContoursRequest) SetContrastAdjustment(value float32)

func (VNDetectContoursRequest) SetContrastPivot

func (d VNDetectContoursRequest) SetContrastPivot(value foundation.NSNumber)

func (VNDetectContoursRequest) SetDetectsDarkOnLight

func (d VNDetectContoursRequest) SetDetectsDarkOnLight(value bool)

func (VNDetectContoursRequest) SetMaximumImageDimension

func (d VNDetectContoursRequest) SetMaximumImageDimension(value uint)

func (VNDetectContoursRequest) VNDetectContourRequestRevision1

func (d VNDetectContoursRequest) VNDetectContourRequestRevision1() int

A constant for specifying revision 1 of the contours detection request.

See: https://developer.apple.com/documentation/vision/vndetectcontourrequestrevision1

type VNDetectContoursRequestClass

type VNDetectContoursRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectContoursRequestClass

func GetVNDetectContoursRequestClass() VNDetectContoursRequestClass

GetVNDetectContoursRequestClass returns the class object for VNDetectContoursRequest.

func (VNDetectContoursRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectDocumentSegmentationRequest

type VNDetectDocumentSegmentationRequest struct {
	VNImageBasedRequest
}

An object that detects rectangular regions that contain text in the input image.

Overview

Perform this request to detect a document in an image. The result that the request generates contains the four corner points of a document’s quadrilateral and saliency mask.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectDocumentSegmentationRequest

func NewDetectDocumentSegmentationRequestWithCompletionHandler

func NewDetectDocumentSegmentationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectDocumentSegmentationRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectDocumentSegmentationRequest

func NewVNDetectDocumentSegmentationRequest() VNDetectDocumentSegmentationRequest

NewVNDetectDocumentSegmentationRequest creates a new VNDetectDocumentSegmentationRequest instance.

func VNDetectDocumentSegmentationRequestFromID

func VNDetectDocumentSegmentationRequestFromID(id objc.ID) VNDetectDocumentSegmentationRequest

VNDetectDocumentSegmentationRequestFromID constructs a VNDetectDocumentSegmentationRequest from an objc.ID.

An object that detects rectangular regions that contain text in the input image.

func (VNDetectDocumentSegmentationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectDocumentSegmentationRequest) Init

Init initializes the instance.

func (VNDetectDocumentSegmentationRequest) VNDetectDocumentSegmentationRequestRevision1

func (d VNDetectDocumentSegmentationRequest) VNDetectDocumentSegmentationRequestRevision1() int

A constant for specifying revision 1 of the document segmentation request.

See: https://developer.apple.com/documentation/vision/vndetectdocumentsegmentationrequestrevision1

type VNDetectDocumentSegmentationRequestClass

type VNDetectDocumentSegmentationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectDocumentSegmentationRequestClass

func GetVNDetectDocumentSegmentationRequestClass() VNDetectDocumentSegmentationRequestClass

GetVNDetectDocumentSegmentationRequestClass returns the class object for VNDetectDocumentSegmentationRequest.

func (VNDetectDocumentSegmentationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectFaceCaptureQualityRequest

type VNDetectFaceCaptureQualityRequest struct {
	VNImageBasedRequest
}

A request that produces a floating-point number that represents the capture quality of a face in a photo.

Overview

This request produces or updates a VNFaceObservation object’s property faceCaptureQuality with a floating-point value. The value ranges from `0` to `1`. Faces with quality closer to `1` are better lit, sharper, and more centrally positioned than faces with quality closer to `0`.

If you don’t execute the request, or the request fails, the property faceCaptureQuality is nil.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectFaceCaptureQualityRequest

func NewDetectFaceCaptureQualityRequestWithCompletionHandler

func NewDetectFaceCaptureQualityRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectFaceCaptureQualityRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectFaceCaptureQualityRequest

func NewVNDetectFaceCaptureQualityRequest() VNDetectFaceCaptureQualityRequest

NewVNDetectFaceCaptureQualityRequest creates a new VNDetectFaceCaptureQualityRequest instance.

func VNDetectFaceCaptureQualityRequestFromID

func VNDetectFaceCaptureQualityRequestFromID(id objc.ID) VNDetectFaceCaptureQualityRequest

VNDetectFaceCaptureQualityRequestFromID constructs a VNDetectFaceCaptureQualityRequest from an objc.ID.

A request that produces a floating-point number that represents the capture quality of a face in a photo.

func (VNDetectFaceCaptureQualityRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectFaceCaptureQualityRequest) FaceCaptureQuality

func (d VNDetectFaceCaptureQualityRequest) FaceCaptureQuality() float32

A value that indicates the quality of the face capture.

See: https://developer.apple.com/documentation/vision/vnfaceobservation/facecapturequality-bjg5

func (VNDetectFaceCaptureQualityRequest) Init

Init initializes the instance.

func (VNDetectFaceCaptureQualityRequest) InputFaceObservations

func (d VNDetectFaceCaptureQualityRequest) InputFaceObservations() []VNFaceObservation

An array of VNFaceObservation objects to process as part of the request.

See: https://developer.apple.com/documentation/Vision/VNFaceObservationAccepting/inputFaceObservations

func (VNDetectFaceCaptureQualityRequest) SetFaceCaptureQuality

func (d VNDetectFaceCaptureQualityRequest) SetFaceCaptureQuality(value float32)

func (VNDetectFaceCaptureQualityRequest) SetInputFaceObservations

func (d VNDetectFaceCaptureQualityRequest) SetInputFaceObservations(value []VNFaceObservation)

func (VNDetectFaceCaptureQualityRequest) VNDetectFaceCaptureQualityRequestRevision1

func (d VNDetectFaceCaptureQualityRequest) VNDetectFaceCaptureQualityRequestRevision1() int

A constant for specifying revision 1 of the face capture detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequestrevision1

func (VNDetectFaceCaptureQualityRequest) VNDetectFaceCaptureQualityRequestRevision2

func (d VNDetectFaceCaptureQualityRequest) VNDetectFaceCaptureQualityRequestRevision2() int

Revision 2 of the request algorithm.

See: https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequestrevision2

type VNDetectFaceCaptureQualityRequestClass

type VNDetectFaceCaptureQualityRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectFaceCaptureQualityRequestClass

func GetVNDetectFaceCaptureQualityRequestClass() VNDetectFaceCaptureQualityRequestClass

GetVNDetectFaceCaptureQualityRequestClass returns the class object for VNDetectFaceCaptureQualityRequest.

func (VNDetectFaceCaptureQualityRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectFaceLandmarksRequest

type VNDetectFaceLandmarksRequest struct {
	VNImageBasedRequest
}

An image-analysis request that finds facial features like eyes and mouth in an image.

Overview

By default, a face landmarks request first locates all faces in the input image, then analyzes each to detect facial features.

If you’ve already located all the faces in an image, or want to detect landmarks in only a subset of the faces in the image, set the VNDetectFaceLandmarksRequest.InputFaceObservations property to an array of VNFaceObservation objects representing the faces you want to analyze. You can either use face observations output by a VNDetectFaceRectanglesRequest or manually create VNFaceObservation instances with the bounding boxes of the faces you want to analyze.

Locating Face Landmarks

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectFaceLandmarksRequest

func NewDetectFaceLandmarksRequestWithCompletionHandler

func NewDetectFaceLandmarksRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectFaceLandmarksRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectFaceLandmarksRequest

func NewVNDetectFaceLandmarksRequest() VNDetectFaceLandmarksRequest

NewVNDetectFaceLandmarksRequest creates a new VNDetectFaceLandmarksRequest instance.

func VNDetectFaceLandmarksRequestFromID

func VNDetectFaceLandmarksRequestFromID(id objc.ID) VNDetectFaceLandmarksRequest

VNDetectFaceLandmarksRequestFromID constructs a VNDetectFaceLandmarksRequest from an objc.ID.

An image-analysis request that finds facial features like eyes and mouth in an image.

func (VNDetectFaceLandmarksRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectFaceLandmarksRequest) Constellation

A variable that describes how a face landmarks request orders or enumerates the resulting features.

Discussion

Set this variable to one of the supported constellation types detailed in VNRequestFaceLandmarksConstellation. The default value is [RequestFaceLandmarksConstellationNotDefined].

See: https://developer.apple.com/documentation/Vision/VNDetectFaceLandmarksRequest/constellation

func (VNDetectFaceLandmarksRequest) Init

Init initializes the instance.

func (VNDetectFaceLandmarksRequest) SetConstellation

func (VNDetectFaceLandmarksRequest) SetInputFaceObservations

func (d VNDetectFaceLandmarksRequest) SetInputFaceObservations(value IVNFaceObservation)

func (VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision1

func (d VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision1() int

A constant for specifying revision 1 of the face landmarks detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision1

func (VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision2

func (d VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision2() int

A constant for specifying revision 2 of the face landmarks detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision2

func (VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision3

func (d VNDetectFaceLandmarksRequest) VNDetectFaceLandmarksRequestRevision3() int

A constant for specifying revision 3 of the face landmarks detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacelandmarksrequestrevision3

type VNDetectFaceLandmarksRequestClass

type VNDetectFaceLandmarksRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectFaceLandmarksRequestClass

func GetVNDetectFaceLandmarksRequestClass() VNDetectFaceLandmarksRequestClass

GetVNDetectFaceLandmarksRequestClass returns the class object for VNDetectFaceLandmarksRequest.

func (VNDetectFaceLandmarksRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

func (VNDetectFaceLandmarksRequestClass) RevisionSupportsConstellation

func (_VNDetectFaceLandmarksRequestClass VNDetectFaceLandmarksRequestClass) RevisionSupportsConstellation(requestRevision uint, constellation VNRequestFaceLandmarksConstellation) bool

Returns a Boolean value that indicates whether a revision supports a constellation.

requestRevision: The revision of the request.

constellation: The contellation for which to determine support.

Return Value

true if the revision supports the constellation, otherwise false.

See: https://developer.apple.com/documentation/Vision/VNDetectFaceLandmarksRequest/revision(_:supportsConstellation:)

type VNDetectFaceRectanglesRequest

type VNDetectFaceRectanglesRequest struct {
	VNImageBasedRequest
}

A request that finds faces within an image.

Overview

This request returns faces as rectangular bounding boxes with origin and size.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectFaceRectanglesRequest

func NewDetectFaceRectanglesRequestWithCompletionHandler

func NewDetectFaceRectanglesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectFaceRectanglesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectFaceRectanglesRequest

func NewVNDetectFaceRectanglesRequest() VNDetectFaceRectanglesRequest

NewVNDetectFaceRectanglesRequest creates a new VNDetectFaceRectanglesRequest instance.

func VNDetectFaceRectanglesRequestFromID

func VNDetectFaceRectanglesRequestFromID(id objc.ID) VNDetectFaceRectanglesRequest

VNDetectFaceRectanglesRequestFromID constructs a VNDetectFaceRectanglesRequest from an objc.ID.

A request that finds faces within an image.

func (VNDetectFaceRectanglesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectFaceRectanglesRequest) Init

Init initializes the instance.

func (VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision1

func (d VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision1() int

A constant for specifying revision 1 of the face rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacerectanglesrequestrevision1

func (VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision2

func (d VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision2() int

A constant for specifying revision 2 of the face rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacerectanglesrequestrevision2

func (VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision3

func (d VNDetectFaceRectanglesRequest) VNDetectFaceRectanglesRequestRevision3() int

A constant for specifying revision 3 of the face rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetectfacerectanglesrequestrevision3

type VNDetectFaceRectanglesRequestClass

type VNDetectFaceRectanglesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectFaceRectanglesRequestClass

func GetVNDetectFaceRectanglesRequestClass() VNDetectFaceRectanglesRequestClass

GetVNDetectFaceRectanglesRequestClass returns the class object for VNDetectFaceRectanglesRequest.

func (VNDetectFaceRectanglesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectHorizonRequest

type VNDetectHorizonRequest struct {
	VNImageBasedRequest
}

An image-analysis request that determines the horizon angle in an image.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectHorizonRequest

func NewDetectHorizonRequestWithCompletionHandler

func NewDetectHorizonRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectHorizonRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectHorizonRequest

func NewVNDetectHorizonRequest() VNDetectHorizonRequest

NewVNDetectHorizonRequest creates a new VNDetectHorizonRequest instance.

func VNDetectHorizonRequestFromID

func VNDetectHorizonRequestFromID(id objc.ID) VNDetectHorizonRequest

VNDetectHorizonRequestFromID constructs a VNDetectHorizonRequest from an objc.ID.

An image-analysis request that determines the horizon angle in an image.

func (VNDetectHorizonRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectHorizonRequest) Init

Init initializes the instance.

func (VNDetectHorizonRequest) VNDetectHorizonRequestRevision1

func (d VNDetectHorizonRequest) VNDetectHorizonRequestRevision1() int

A constant for specifying revision 1 of the horizon detection request.

See: https://developer.apple.com/documentation/vision/vndetecthorizonrequestrevision1

type VNDetectHorizonRequestClass

type VNDetectHorizonRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectHorizonRequestClass

func GetVNDetectHorizonRequestClass() VNDetectHorizonRequestClass

GetVNDetectHorizonRequestClass returns the class object for VNDetectHorizonRequest.

func (VNDetectHorizonRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectHumanBodyPose3DRequest

type VNDetectHumanBodyPose3DRequest struct {
	VNStatefulRequest
}

A request that detects points on human bodies in 3D space, relative to the camera.

Overview

This request generates a collection of VNHumanBodyPose3DObservation objects that describe the position of each body the request detects. If the system allows it, the request uses AVDepthData information to improve the accuracy.

Determining Supported Joints

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPose3DRequest

func NewDetectHumanBodyPose3DRequestWithCompletionHandler

func NewDetectHumanBodyPose3DRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectHumanBodyPose3DRequest

Creates a new 3D body pose request with a completion handler.

completionHandler: The block to invoke after the request finishes processing.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPose3DRequest/init(completionHandler:)

func NewDetectHumanBodyPose3DRequestWithFrameAnalysisSpacingCompletionHandler

func NewDetectHumanBodyPose3DRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNDetectHumanBodyPose3DRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNDetectHumanBodyPose3DRequest

func NewVNDetectHumanBodyPose3DRequest() VNDetectHumanBodyPose3DRequest

NewVNDetectHumanBodyPose3DRequest creates a new VNDetectHumanBodyPose3DRequest instance.

func VNDetectHumanBodyPose3DRequestFromID

func VNDetectHumanBodyPose3DRequestFromID(id objc.ID) VNDetectHumanBodyPose3DRequest

VNDetectHumanBodyPose3DRequestFromID constructs a VNDetectHumanBodyPose3DRequest from an objc.ID.

A request that detects points on human bodies in 3D space, relative to the camera.

func (VNDetectHumanBodyPose3DRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectHumanBodyPose3DRequest) Init

Init initializes the instance.

func (VNDetectHumanBodyPose3DRequest) SetSupportedJointNames

func (VNDetectHumanBodyPose3DRequest) SetSupportedJointsGroupNames

func (VNDetectHumanBodyPose3DRequest) SupportedJointNames

Returns the joint group names the request supports.

See: https://developer.apple.com/documentation/vision/vndetecthumanbodypose3drequest/supportedjointnames

func (VNDetectHumanBodyPose3DRequest) SupportedJointNamesAndReturnError

func (d VNDetectHumanBodyPose3DRequest) SupportedJointNamesAndReturnError() ([]string, error)

Returns the joint names the request supports.

Return Value

The array of joint name objects.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPose3DRequest/supportedJointNamesAndReturnError:

func (VNDetectHumanBodyPose3DRequest) SupportedJointsGroupNamesAndReturnError

func (d VNDetectHumanBodyPose3DRequest) SupportedJointsGroupNamesAndReturnError() ([]string, error)

Returns the joint group names the request supports.

Return Value

The array of joint group name objects.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPose3DRequest/supportedJointsGroupNamesAndReturnError:

type VNDetectHumanBodyPose3DRequestClass

type VNDetectHumanBodyPose3DRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectHumanBodyPose3DRequestClass

func GetVNDetectHumanBodyPose3DRequestClass() VNDetectHumanBodyPose3DRequestClass

GetVNDetectHumanBodyPose3DRequestClass returns the class object for VNDetectHumanBodyPose3DRequest.

func (VNDetectHumanBodyPose3DRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectHumanBodyPoseRequest

type VNDetectHumanBodyPoseRequest struct {
	VNImageBasedRequest
}

A request that detects a human body pose.

Overview

The framework provides the detected body pose as a VNHumanBodyPoseObservation.

Determining Supported Joints

Identifying Body Pose Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPoseRequest

func NewDetectHumanBodyPoseRequestWithCompletionHandler

func NewDetectHumanBodyPoseRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectHumanBodyPoseRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectHumanBodyPoseRequest

func NewVNDetectHumanBodyPoseRequest() VNDetectHumanBodyPoseRequest

NewVNDetectHumanBodyPoseRequest creates a new VNDetectHumanBodyPoseRequest instance.

func VNDetectHumanBodyPoseRequestFromID

func VNDetectHumanBodyPoseRequestFromID(id objc.ID) VNDetectHumanBodyPoseRequest

VNDetectHumanBodyPoseRequestFromID constructs a VNDetectHumanBodyPoseRequest from an objc.ID.

A request that detects a human body pose.

func (VNDetectHumanBodyPoseRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectHumanBodyPoseRequest) Init

Init initializes the instance.

func (VNDetectHumanBodyPoseRequest) SetSupportedJointNames

func (d VNDetectHumanBodyPoseRequest) SetSupportedJointNames(value VNHumanBodyPoseObservationJointName)

func (VNDetectHumanBodyPoseRequest) SetSupportedJointsGroupNames

func (d VNDetectHumanBodyPoseRequest) SetSupportedJointsGroupNames(value VNHumanBodyPoseObservationJointsGroupName)

func (VNDetectHumanBodyPoseRequest) SupportedJointNamesAndReturnError

func (d VNDetectHumanBodyPoseRequest) SupportedJointNamesAndReturnError() ([]string, error)

Retrieves the supported joint names.

error: If an error occurs, an error object that describes the error; otherwise, `nil`.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPoseRequest/supportedJointNamesAndReturnError:

func (VNDetectHumanBodyPoseRequest) SupportedJointsGroupNamesAndReturnError

func (d VNDetectHumanBodyPoseRequest) SupportedJointsGroupNamesAndReturnError() ([]string, error)

Retrieves the supported joint group names.

error: If an error occurs, an error object that describes the error; otherwise, `nil`.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanBodyPoseRequest/supportedJointsGroupNamesAndReturnError:

func (VNDetectHumanBodyPoseRequest) VNDetectHumanBodyPoseRequestRevision1

func (d VNDetectHumanBodyPoseRequest) VNDetectHumanBodyPoseRequestRevision1() int

A constant for specifying revision 1 of the body pose detection request.

See: https://developer.apple.com/documentation/vision/vndetecthumanbodyposerequestrevision1

type VNDetectHumanBodyPoseRequestClass

type VNDetectHumanBodyPoseRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectHumanBodyPoseRequestClass

func GetVNDetectHumanBodyPoseRequestClass() VNDetectHumanBodyPoseRequestClass

GetVNDetectHumanBodyPoseRequestClass returns the class object for VNDetectHumanBodyPoseRequest.

func (VNDetectHumanBodyPoseRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectHumanHandPoseRequest

type VNDetectHumanHandPoseRequest struct {
	VNImageBasedRequest
}

A request that detects a human hand pose.

Overview

The framework provides the detected hand pose as a [VNIdentifiedPointsObservation].

Configuring the Request

Determining Supported Joints

Identifying Hand Pose Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectHumanHandPoseRequest

func NewDetectHumanHandPoseRequestWithCompletionHandler

func NewDetectHumanHandPoseRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectHumanHandPoseRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectHumanHandPoseRequest

func NewVNDetectHumanHandPoseRequest() VNDetectHumanHandPoseRequest

NewVNDetectHumanHandPoseRequest creates a new VNDetectHumanHandPoseRequest instance.

func VNDetectHumanHandPoseRequestFromID

func VNDetectHumanHandPoseRequestFromID(id objc.ID) VNDetectHumanHandPoseRequest

VNDetectHumanHandPoseRequestFromID constructs a VNDetectHumanHandPoseRequest from an objc.ID.

A request that detects a human hand pose.

func (VNDetectHumanHandPoseRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectHumanHandPoseRequest) Init

Init initializes the instance.

func (VNDetectHumanHandPoseRequest) MaximumHandCount

func (d VNDetectHumanHandPoseRequest) MaximumHandCount() uint

The maximum number of hands to detect in an image.

Discussion

The request orders detected hands by relative size, with only the largest ones having key points determined.

The default value is 2.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanHandPoseRequest/maximumHandCount

func (VNDetectHumanHandPoseRequest) SetMaximumHandCount

func (d VNDetectHumanHandPoseRequest) SetMaximumHandCount(value uint)

func (VNDetectHumanHandPoseRequest) SetSupportedJointNames

func (d VNDetectHumanHandPoseRequest) SetSupportedJointNames(value VNHumanHandPoseObservationJointName)

func (VNDetectHumanHandPoseRequest) SetSupportedJointsGroupNames

func (d VNDetectHumanHandPoseRequest) SetSupportedJointsGroupNames(value VNHumanHandPoseObservationJointsGroupName)

func (VNDetectHumanHandPoseRequest) SupportedJointNamesAndReturnError

func (d VNDetectHumanHandPoseRequest) SupportedJointNamesAndReturnError() ([]string, error)

Retrieves the supported joint names.

error: If an error occurs, an error object that describes the error; otherwise, `nil`.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanHandPoseRequest/supportedJointNamesAndReturnError:

func (VNDetectHumanHandPoseRequest) SupportedJointsGroupNamesAndReturnError

func (d VNDetectHumanHandPoseRequest) SupportedJointsGroupNamesAndReturnError() ([]string, error)

Retrieves the supported joint group names.

error: If an error occurs, an error object that describes the error; otherwise, `nil`.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanHandPoseRequest/supportedJointsGroupNamesAndReturnError:

func (VNDetectHumanHandPoseRequest) VNDetectHumanHandPoseRequestRevision1

func (d VNDetectHumanHandPoseRequest) VNDetectHumanHandPoseRequestRevision1() int

A constant for specifying revision 1 of the hand pose detection request.

See: https://developer.apple.com/documentation/vision/vndetecthumanhandposerequestrevision1

type VNDetectHumanHandPoseRequestClass

type VNDetectHumanHandPoseRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectHumanHandPoseRequestClass

func GetVNDetectHumanHandPoseRequestClass() VNDetectHumanHandPoseRequestClass

GetVNDetectHumanHandPoseRequestClass returns the class object for VNDetectHumanHandPoseRequest.

func (VNDetectHumanHandPoseRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectHumanRectanglesRequest

type VNDetectHumanRectanglesRequest struct {
	VNImageBasedRequest
}

A request that finds rectangular regions that contain people in an image.

Configuring the Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectHumanRectanglesRequest

func NewDetectHumanRectanglesRequestWithCompletionHandler

func NewDetectHumanRectanglesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectHumanRectanglesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectHumanRectanglesRequest

func NewVNDetectHumanRectanglesRequest() VNDetectHumanRectanglesRequest

NewVNDetectHumanRectanglesRequest creates a new VNDetectHumanRectanglesRequest instance.

func VNDetectHumanRectanglesRequestFromID

func VNDetectHumanRectanglesRequestFromID(id objc.ID) VNDetectHumanRectanglesRequest

VNDetectHumanRectanglesRequestFromID constructs a VNDetectHumanRectanglesRequest from an objc.ID.

A request that finds rectangular regions that contain people in an image.

func (VNDetectHumanRectanglesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectHumanRectanglesRequest) Init

Init initializes the instance.

func (VNDetectHumanRectanglesRequest) SetUpperBodyOnly

func (d VNDetectHumanRectanglesRequest) SetUpperBodyOnly(value bool)

func (VNDetectHumanRectanglesRequest) UpperBodyOnly

func (d VNDetectHumanRectanglesRequest) UpperBodyOnly() bool

A Boolean value that indicates whether the request requires detecting a full body or upper body only to produce a result.

Discussion

The default value of true indicates that the request requires detecting a person’s upper body only to find the bound box around it.

See: https://developer.apple.com/documentation/Vision/VNDetectHumanRectanglesRequest/upperBodyOnly

func (VNDetectHumanRectanglesRequest) VNDetectHumanRectanglesRequestRevision1

func (d VNDetectHumanRectanglesRequest) VNDetectHumanRectanglesRequestRevision1() int

A constant for specifying revision 1 of the human rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision1

func (VNDetectHumanRectanglesRequest) VNDetectHumanRectanglesRequestRevision2

func (d VNDetectHumanRectanglesRequest) VNDetectHumanRectanglesRequestRevision2() int

A constant for specifying revision 2 of the human rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequestrevision2

type VNDetectHumanRectanglesRequestClass

type VNDetectHumanRectanglesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectHumanRectanglesRequestClass

func GetVNDetectHumanRectanglesRequestClass() VNDetectHumanRectanglesRequestClass

GetVNDetectHumanRectanglesRequestClass returns the class object for VNDetectHumanRectanglesRequest.

func (VNDetectHumanRectanglesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectRectanglesRequest

type VNDetectRectanglesRequest struct {
	VNImageBasedRequest
}

An image-analysis request that finds projected rectangular regions in an image.

Overview

A rectangle detection request locates regions of an image with rectangular shape, like credit cards, business cards, documents, and signs. The request returns its observations in the form of VNRectangleObservation objects, which contain normalized coordinates of bounding boxes containing the rectangle.

Use this type of request to find the bounding boxes of rectangles in an image. Vision returns observations for rectangles found in all orientations and sizes, along with a confidence level to indicate how likely it’s that the observation contains an actual rectangle.

To further configure or restrict the types of rectangles found, set properties on the request specifying a range of aspect ratios, sizes, and quadrature tolerance.

Configuring Detection

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest

func NewDetectRectanglesRequestWithCompletionHandler

func NewDetectRectanglesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectRectanglesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectRectanglesRequest

func NewVNDetectRectanglesRequest() VNDetectRectanglesRequest

NewVNDetectRectanglesRequest creates a new VNDetectRectanglesRequest instance.

func VNDetectRectanglesRequestFromID

func VNDetectRectanglesRequestFromID(id objc.ID) VNDetectRectanglesRequest

VNDetectRectanglesRequestFromID constructs a VNDetectRectanglesRequest from an objc.ID.

An image-analysis request that finds projected rectangular regions in an image.

func (VNDetectRectanglesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectRectanglesRequest) Init

Init initializes the instance.

func (VNDetectRectanglesRequest) MaximumAspectRatio

func (d VNDetectRectanglesRequest) MaximumAspectRatio() VNAspectRatio

A `float` specifying the maximum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.

Discussion

The value should range from `0.0` to `1.0`, inclusive. The default value is `0.5`.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/maximumAspectRatio

func (VNDetectRectanglesRequest) MaximumObservations

func (d VNDetectRectanglesRequest) MaximumObservations() uint

An integer specifying the maximum number of rectangles Vision returns.

Discussion

The default value is `1`.

Setting this property to `0` allows Vision algorithms to return an unlimited number of observations.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/maximumObservations

func (VNDetectRectanglesRequest) MinimumAspectRatio

func (d VNDetectRectanglesRequest) MinimumAspectRatio() VNAspectRatio

A `float` specifying the minimum aspect ratio of the rectangle to detect, defined as the shorter dimension over the longer dimension.

Discussion

The value should range from `0.0` to `1.0`, inclusive. The default value is `0.5`.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/minimumAspectRatio

func (VNDetectRectanglesRequest) MinimumConfidence

func (d VNDetectRectanglesRequest) MinimumConfidence() VNConfidence

A value specifying the minimum acceptable confidence level.

Discussion

Vision won’t return rectangles with a confidence score lower than the specified minimum.

The confidence score ranges from `0.0` to `1.0`, inclusive, where `0.0` represents no confidence, and `1.0` represents full confidence.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/minimumConfidence

func (VNDetectRectanglesRequest) MinimumSize

func (d VNDetectRectanglesRequest) MinimumSize() float32

The minimum size of a rectangle to detect, as a proportion of the smallest dimension.

Discussion

The value should range from `0.0` to `1.0` inclusive. The default minimum size is `0.2`.

Any smaller rectangles that Vision may have detected aren’t returned.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/minimumSize

func (VNDetectRectanglesRequest) QuadratureTolerance

func (d VNDetectRectanglesRequest) QuadratureTolerance() VNDegrees

A float specifying the number of degrees a rectangle corner angle can deviate from 90°.

Discussion

The tolerance value should range from `0` to `45`, inclusive. The default tolerance is `30`.

See: https://developer.apple.com/documentation/Vision/VNDetectRectanglesRequest/quadratureTolerance

func (VNDetectRectanglesRequest) SetMaximumAspectRatio

func (d VNDetectRectanglesRequest) SetMaximumAspectRatio(value VNAspectRatio)

func (VNDetectRectanglesRequest) SetMaximumObservations

func (d VNDetectRectanglesRequest) SetMaximumObservations(value uint)

func (VNDetectRectanglesRequest) SetMinimumAspectRatio

func (d VNDetectRectanglesRequest) SetMinimumAspectRatio(value VNAspectRatio)

func (VNDetectRectanglesRequest) SetMinimumConfidence

func (d VNDetectRectanglesRequest) SetMinimumConfidence(value VNConfidence)

func (VNDetectRectanglesRequest) SetMinimumSize

func (d VNDetectRectanglesRequest) SetMinimumSize(value float32)

func (VNDetectRectanglesRequest) SetQuadratureTolerance

func (d VNDetectRectanglesRequest) SetQuadratureTolerance(value VNDegrees)

func (VNDetectRectanglesRequest) VNDetectRectanglesRequestRevision1

func (d VNDetectRectanglesRequest) VNDetectRectanglesRequestRevision1() int

A constant for specifying revision 1 of the rectangle detection request.

See: https://developer.apple.com/documentation/vision/vndetectrectanglesrequestrevision1

type VNDetectRectanglesRequestClass

type VNDetectRectanglesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectRectanglesRequestClass

func GetVNDetectRectanglesRequestClass() VNDetectRectanglesRequestClass

GetVNDetectRectanglesRequestClass returns the class object for VNDetectRectanglesRequest.

func (VNDetectRectanglesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectTextRectanglesRequest

type VNDetectTextRectanglesRequest struct {
	VNImageBasedRequest
}

An image-analysis request that finds regions of visible text in an image.

Overview

This request returns detected text characters as rectangular bounding boxes with origin and size.

Configuring a Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectTextRectanglesRequest

func NewDetectTextRectanglesRequestWithCompletionHandler

func NewDetectTextRectanglesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectTextRectanglesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNDetectTextRectanglesRequest

func NewVNDetectTextRectanglesRequest() VNDetectTextRectanglesRequest

NewVNDetectTextRectanglesRequest creates a new VNDetectTextRectanglesRequest instance.

func VNDetectTextRectanglesRequestFromID

func VNDetectTextRectanglesRequestFromID(id objc.ID) VNDetectTextRectanglesRequest

VNDetectTextRectanglesRequestFromID constructs a VNDetectTextRectanglesRequest from an objc.ID.

An image-analysis request that finds regions of visible text in an image.

func (VNDetectTextRectanglesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectTextRectanglesRequest) Init

Init initializes the instance.

func (VNDetectTextRectanglesRequest) ReportCharacterBoxes

func (d VNDetectTextRectanglesRequest) ReportCharacterBoxes() bool

A Boolean value that indicates whether the request detects character bounding boxes.

Discussion

Set the value to true to have the detector return character bounding boxes as an array of VNRectangleObservation objects.

See: https://developer.apple.com/documentation/Vision/VNDetectTextRectanglesRequest/reportCharacterBoxes

func (VNDetectTextRectanglesRequest) SetReportCharacterBoxes

func (d VNDetectTextRectanglesRequest) SetReportCharacterBoxes(value bool)

func (VNDetectTextRectanglesRequest) VNDetectTextRectanglesRequestRevision1

func (d VNDetectTextRectanglesRequest) VNDetectTextRectanglesRequestRevision1() int

A constant for specifying revision 1 of the text rectangles detection request.

See: https://developer.apple.com/documentation/vision/vndetecttextrectanglesrequestrevision1

type VNDetectTextRectanglesRequestClass

type VNDetectTextRectanglesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectTextRectanglesRequestClass

func GetVNDetectTextRectanglesRequestClass() VNDetectTextRectanglesRequestClass

GetVNDetectTextRectanglesRequestClass returns the class object for VNDetectTextRectanglesRequest.

func (VNDetectTextRectanglesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectTrajectoriesRequest

type VNDetectTrajectoriesRequest struct {
	VNStatefulRequest
}

A request that detects the trajectories of shapes moving along a parabolic path.

Overview

After the request detects a trajectory, it produces an observation that contains the shape’s detected points and an equation describing the parabola.

Creating a Request

Configuring the Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest

func NewDetectTrajectoriesRequestWithCompletionHandler

func NewDetectTrajectoriesRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNDetectTrajectoriesRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingCompletionHandler

func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNDetectTrajectoriesRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler

func NewDetectTrajectoriesRequestWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing objectivec.IObject, trajectoryLength int, completionHandler VNRequestCompletionHandler) VNDetectTrajectoriesRequest

Creates a new request to detect trajectories.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

trajectoryLength: The number of points required to analyze to determine that a shape follows a parabolic path. This argument value must be at least 5.

completionHandler: A closure that’s invoked after the request completes its processing. The system invokes the completion handler on the same dispatch queue that the request uses to perform its processing.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/init(frameAnalysisSpacing:trajectoryLength:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNDetectTrajectoriesRequest

func NewVNDetectTrajectoriesRequest() VNDetectTrajectoriesRequest

NewVNDetectTrajectoriesRequest creates a new VNDetectTrajectoriesRequest instance.

func VNDetectTrajectoriesRequestFromID

func VNDetectTrajectoriesRequestFromID(id objc.ID) VNDetectTrajectoriesRequest

VNDetectTrajectoriesRequestFromID constructs a VNDetectTrajectoriesRequest from an objc.ID.

A request that detects the trajectories of shapes moving along a parabolic path.

func (VNDetectTrajectoriesRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectTrajectoriesRequest) Init

Init initializes the instance.

func (VNDetectTrajectoriesRequest) InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler

func (d VNDetectTrajectoriesRequest) InitWithFrameAnalysisSpacingTrajectoryLengthCompletionHandler(frameAnalysisSpacing objectivec.IObject, trajectoryLength int, completionHandler ErrorHandler) VNDetectTrajectoriesRequest

Creates a new request to detect trajectories.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

trajectoryLength: The number of points required to analyze to determine that a shape follows a parabolic path. This argument value must be at least 5.

completionHandler: A closure that’s invoked after the request completes its processing. The system invokes the completion handler on the same dispatch queue that the request uses to perform its processing.

frameAnalysisSpacing is a [coremedia.CMTime].

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/init(frameAnalysisSpacing:trajectoryLength:completionHandler:)

func (VNDetectTrajectoriesRequest) ObjectMaximumNormalizedRadius

func (d VNDetectTrajectoriesRequest) ObjectMaximumNormalizedRadius() float32

The maximum radius of the bounding circle of the object to track.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/objectMaximumNormalizedRadius

func (VNDetectTrajectoriesRequest) ObjectMinimumNormalizedRadius

func (d VNDetectTrajectoriesRequest) ObjectMinimumNormalizedRadius() float32

The minimum radius of the bounding circle of the object to track.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/objectMinimumNormalizedRadius

func (VNDetectTrajectoriesRequest) SetObjectMaximumNormalizedRadius

func (d VNDetectTrajectoriesRequest) SetObjectMaximumNormalizedRadius(value float32)

func (VNDetectTrajectoriesRequest) SetObjectMinimumNormalizedRadius

func (d VNDetectTrajectoriesRequest) SetObjectMinimumNormalizedRadius(value float32)

func (VNDetectTrajectoriesRequest) SetTargetFrameTime

func (d VNDetectTrajectoriesRequest) SetTargetFrameTime(value objectivec.IObject)

func (VNDetectTrajectoriesRequest) TargetFrameTime

func (d VNDetectTrajectoriesRequest) TargetFrameTime() objectivec.IObject

The requested target frame time for processing trajectory detection.

Discussion

Use this property value for real-time processing of frames, which requires execution within a specific amount of time. The request evaluates from frame-to-frame. If processing takes longer than the targeted time for the current frame, it attempts to decrease the overall time by reducing the accuracy (down to a set minimum) for the next frame. If a frame takes less time than the targeted time, the request increases the accuracy (up to a set maximum) of the next frame.

The default value is indefinite, which indicates that accuracy stays at the predefined maximum.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/targetFrameTime

func (VNDetectTrajectoriesRequest) TrajectoryLength

func (d VNDetectTrajectoriesRequest) TrajectoryLength() int

The number of points to detect before calculating a trajectory.

See: https://developer.apple.com/documentation/Vision/VNDetectTrajectoriesRequest/trajectoryLength

func (VNDetectTrajectoriesRequest) VNDetectTrajectoriesRequestRevision1

func (d VNDetectTrajectoriesRequest) VNDetectTrajectoriesRequestRevision1() int

A constant for specifying revision 1 of the trajectories detection request.

See: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequestrevision1

type VNDetectTrajectoriesRequestClass

type VNDetectTrajectoriesRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectTrajectoriesRequestClass

func GetVNDetectTrajectoriesRequestClass() VNDetectTrajectoriesRequestClass

GetVNDetectTrajectoriesRequestClass returns the class object for VNDetectTrajectoriesRequest.

func (VNDetectTrajectoriesRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectedObjectObservation

type VNDetectedObjectObservation struct {
	VNObservation
}

An observation that provides the position and extent of an image feature that an image- analysis request detects.

Overview

This class is the observation type that VNTrackObjectRequest generates. It represents an object that the Vision request detects and tracks.

Locating a Detected Object

Accessing an Image Mask

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation

func NewDetectedObjectObservationWithBoundingBox

func NewDetectedObjectObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNDetectedObjectObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewDetectedObjectObservationWithRequestRevisionBoundingBox

func NewDetectedObjectObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNDetectedObjectObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNDetectedObjectObservation

func NewVNDetectedObjectObservation() VNDetectedObjectObservation

NewVNDetectedObjectObservation creates a new VNDetectedObjectObservation instance.

func VNDetectedObjectObservationFromID

func VNDetectedObjectObservationFromID(id objc.ID) VNDetectedObjectObservation

VNDetectedObjectObservationFromID constructs a VNDetectedObjectObservation from an objc.ID.

An observation that provides the position and extent of an image feature that an image- analysis request detects.

func (VNDetectedObjectObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectedObjectObservation) BoundingBox

The bounding box of the object that the request detects.

Discussion

The system normalizes the coordinates to the dimensions of the processed image, with the origin at the lower-left corner of the image.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/boundingBox

func (VNDetectedObjectObservation) EncodeWithCoder

func (d VNDetectedObjectObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNDetectedObjectObservation) GlobalSegmentationMask

func (d VNDetectedObjectObservation) GlobalSegmentationMask() IVNPixelBufferObservation

A resulting pixel buffer from a request to generate a segmentation mask for an image.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/globalSegmentationMask

func (VNDetectedObjectObservation) Init

Init initializes the instance.

type VNDetectedObjectObservationClass

type VNDetectedObjectObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectedObjectObservationClass

func GetVNDetectedObjectObservationClass() VNDetectedObjectObservationClass

GetVNDetectedObjectObservationClass returns the class object for VNDetectedObjectObservation.

func (VNDetectedObjectObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNDetectedPoint

type VNDetectedPoint struct {
	VNPoint
}

An object that represents a normalized point in an image, along with a confidence value.

Inspecting a Point

See: https://developer.apple.com/documentation/Vision/VNDetectedPoint

func NewDetectedPointWithLocation

func NewDetectedPointWithLocation(location corefoundation.CGPoint) VNDetectedPoint

Creates a point object from the specified Core Graphics point.

location: The Core Graphics point.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(location:)

func NewDetectedPointWithXY

func NewDetectedPointWithXY(x float64, y float64) VNDetectedPoint

Creates a point object with the specified coordinates.

x: The x-coordinate value.

y: The y-coordinate value.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(x:y:)

func NewVNDetectedPoint

func NewVNDetectedPoint() VNDetectedPoint

NewVNDetectedPoint creates a new VNDetectedPoint instance.

func VNDetectedPointFromID

func VNDetectedPointFromID(id objc.ID) VNDetectedPoint

VNDetectedPointFromID constructs a VNDetectedPoint from an objc.ID.

An object that represents a normalized point in an image, along with a confidence value.

func (VNDetectedPoint) Autorelease

func (d VNDetectedPoint) Autorelease() VNDetectedPoint

Autorelease adds the receiver to the current autorelease pool.

func (VNDetectedPoint) Confidence

func (d VNDetectedPoint) Confidence() VNConfidence

A confidence score that indicates the detected point’s accuracy.

See: https://developer.apple.com/documentation/Vision/VNDetectedPoint/confidence

func (VNDetectedPoint) EncodeWithCoder

func (d VNDetectedPoint) EncodeWithCoder(coder foundation.INSCoder)

func (VNDetectedPoint) Init

Init initializes the instance.

type VNDetectedPointClass

type VNDetectedPointClass struct {
	// contains filtered or unexported fields
}

func GetVNDetectedPointClass

func GetVNDetectedPointClass() VNDetectedPointClass

GetVNDetectedPointClass returns the class object for VNDetectedPoint.

func (VNDetectedPointClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNElementType

type VNElementType int

See: https://developer.apple.com/documentation/Vision/VNElementType

const (
	// VNElementTypeDouble: The elements are double-precision floating-point numbers.
	VNElementTypeDouble VNElementType = 2
	// VNElementTypeFloat: The elements are floating-point numbers.
	VNElementTypeFloat VNElementType = 1
	// VNElementTypeUnknown: The element type isn’t known.
	VNElementTypeUnknown VNElementType = 0
)

func (VNElementType) String

func (e VNElementType) String() string

type VNErrorCode

type VNErrorCode int

See: https://developer.apple.com/documentation/Vision/VNErrorCode

const (
	// VNErrorDataUnavailable: The data isn’t available.
	VNErrorDataUnavailable VNErrorCode = 17
	// VNErrorIOError: An I/O error for an image, image sequence, or Core ML model.
	VNErrorIOError VNErrorCode = 6
	// VNErrorInternalError: An internal error occurred within the framework.
	VNErrorInternalError VNErrorCode = 9
	// VNErrorInvalidArgument: An app passed an invalid parameter to a request.
	VNErrorInvalidArgument VNErrorCode = 14
	// VNErrorInvalidFormat: The format of the image is invalid.
	VNErrorInvalidFormat VNErrorCode = 2
	// VNErrorInvalidImage: The image is invalid.
	VNErrorInvalidImage VNErrorCode = 13
	// VNErrorInvalidModel: The Core ML model is incompatible with the request.
	VNErrorInvalidModel VNErrorCode = 15
	// VNErrorInvalidOperation: An app requested an unsupported operation.
	VNErrorInvalidOperation VNErrorCode = 12
	// VNErrorInvalidOption: An app specified an invalid option on a request.
	VNErrorInvalidOption VNErrorCode = 5
	// VNErrorMissingOption: A request is missing a required option.
	VNErrorMissingOption VNErrorCode = 7
	// VNErrorNotImplemented: The method isn’t implemented in the underlying model.
	VNErrorNotImplemented VNErrorCode = 8
	// VNErrorOK: The operation finished without error.
	VNErrorOK VNErrorCode = 0
	// VNErrorOperationFailed: The requested operation failed.
	VNErrorOperationFailed VNErrorCode = 3
	// VNErrorOutOfBoundsError: An app attempted to access data that’s out-of-bounds.
	VNErrorOutOfBoundsError VNErrorCode = 4
	// VNErrorOutOfMemory: The system doesn’t have enough memory to complete the request.
	VNErrorOutOfMemory VNErrorCode = 10
	// VNErrorRequestCancelled: An app canceled the request.
	VNErrorRequestCancelled VNErrorCode = 1
	// VNErrorTimeStampNotFound: The system can’t find a timestamp.
	VNErrorTimeStampNotFound VNErrorCode = 18
	// VNErrorTimeout: The requested operation timed out.
	VNErrorTimeout VNErrorCode = 20
	// VNErrorTuriCoreErrorCode: An error occurred during Create ML training due to an invalid transformation or image.
	VNErrorTuriCoreErrorCode VNErrorCode = -1
	// VNErrorUnknownError: An unidentified error occurred.
	VNErrorUnknownError VNErrorCode = 11
	// VNErrorUnsupportedComputeDevice: An app requested an unsupported compute device.
	VNErrorUnsupportedComputeDevice VNErrorCode = 22
	// VNErrorUnsupportedComputeStage: An app requested an unsupported compute stage.
	VNErrorUnsupportedComputeStage VNErrorCode = 21
	// VNErrorUnsupportedRequest: An app attempted an unsupported request.
	VNErrorUnsupportedRequest VNErrorCode = 19
	// VNErrorUnsupportedRevision: An app specified an unsupported request revision.
	VNErrorUnsupportedRevision VNErrorCode = 16
)

func (VNErrorCode) String

func (e VNErrorCode) String() string

type VNFaceLandmarkRegion

type VNFaceLandmarkRegion struct {
	objectivec.Object
}

The abstract superclass for information about a specific face landmark.

Instance Properties

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion

func NewVNFaceLandmarkRegion

func NewVNFaceLandmarkRegion() VNFaceLandmarkRegion

NewVNFaceLandmarkRegion creates a new VNFaceLandmarkRegion instance.

func VNFaceLandmarkRegionFromID

func VNFaceLandmarkRegionFromID(id objc.ID) VNFaceLandmarkRegion

VNFaceLandmarkRegionFromID constructs a VNFaceLandmarkRegion from an objc.ID.

The abstract superclass for information about a specific face landmark.

func (VNFaceLandmarkRegion) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNFaceLandmarkRegion) EncodeWithCoder

func (f VNFaceLandmarkRegion) EncodeWithCoder(coder foundation.INSCoder)

func (VNFaceLandmarkRegion) Init

Init initializes the instance.

func (VNFaceLandmarkRegion) Landmarks

The facial features of the detected face.

See: https://developer.apple.com/documentation/vision/vnfaceobservation/landmarks

func (VNFaceLandmarkRegion) PointCount

func (f VNFaceLandmarkRegion) PointCount() uint

The number of points in the face region.

Discussion

The value is zero if no points for a region could be found.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion/pointCount

func (VNFaceLandmarkRegion) RequestRevision

func (f VNFaceLandmarkRegion) RequestRevision() uint

The revision of the VNRequest subclass used to generate the implementing object.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision

func (VNFaceLandmarkRegion) SetLandmarks

func (f VNFaceLandmarkRegion) SetLandmarks(value IVNFaceLandmarks2D)

type VNFaceLandmarkRegion2D

type VNFaceLandmarkRegion2D struct {
	VNFaceLandmarkRegion
}

2D geometry information for a specific facial feature.

Overview

This class represents the set of all facial landmark regions in 2D, exposed as properties.

Describing Region Points

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D

func NewVNFaceLandmarkRegion2D

func NewVNFaceLandmarkRegion2D() VNFaceLandmarkRegion2D

NewVNFaceLandmarkRegion2D creates a new VNFaceLandmarkRegion2D instance.

func VNFaceLandmarkRegion2DFromID

func VNFaceLandmarkRegion2DFromID(id objc.ID) VNFaceLandmarkRegion2D

VNFaceLandmarkRegion2DFromID constructs a VNFaceLandmarkRegion2D from an objc.ID.

2D geometry information for a specific facial feature.

func (VNFaceLandmarkRegion2D) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNFaceLandmarkRegion2D) EncodeWithCoder

func (f VNFaceLandmarkRegion2D) EncodeWithCoder(coder foundation.INSCoder)

func (VNFaceLandmarkRegion2D) Init

Init initializes the instance.

func (VNFaceLandmarkRegion2D) NormalizedPoints

func (f VNFaceLandmarkRegion2D) NormalizedPoints() unsafe.Pointer

A buffer in memory containing normalized landmark points.

Discussion

This pointer points to the address of a buffer containing CGPoint structs representing landmark points.

The target object owns this buffer, which is guaranteed to exist as long as the corresponding VNFaceLandmarkRegion2D exists.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D/normalizedPoints-1o38f

func (VNFaceLandmarkRegion2D) PointsClassification

func (f VNFaceLandmarkRegion2D) PointsClassification() VNPointsClassification

An enumeration that describes how to interpret the points the region provides.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D/pointsClassification

func (VNFaceLandmarkRegion2D) PointsInImageOfSize

func (f VNFaceLandmarkRegion2D) PointsInImageOfSize(imageSize corefoundation.CGSize) corefoundation.CGPoint

A buffer in memory containing landmark points in the coordinate space of the specified image size.

imageSize: The pixel dimensions of the image in which to present landmark points.

Return Value

A pointer to a buffer containing a CGPoint for each landmark detected in the image, expressed in the coordinate space of the specified image size.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D/pointsInImageOfSize:

func (VNFaceLandmarkRegion2D) PrecisionEstimatesPerPoint

func (f VNFaceLandmarkRegion2D) PrecisionEstimatesPerPoint() []foundation.NSNumber

An array of precision estimates for each landmark point.

Discussion

This property is only populated when you configure your VNDetectFaceLandmarksRequest object with [RequestFaceLandmarksConstellation76Points]. For other constellation types, this array is set to `nil`.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarkRegion2D/precisionEstimatesPerPoint-3kx5a

type VNFaceLandmarkRegion2DClass

type VNFaceLandmarkRegion2DClass struct {
	// contains filtered or unexported fields
}

func GetVNFaceLandmarkRegion2DClass

func GetVNFaceLandmarkRegion2DClass() VNFaceLandmarkRegion2DClass

GetVNFaceLandmarkRegion2DClass returns the class object for VNFaceLandmarkRegion2D.

func (VNFaceLandmarkRegion2DClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNFaceLandmarkRegionClass

type VNFaceLandmarkRegionClass struct {
	// contains filtered or unexported fields
}

func GetVNFaceLandmarkRegionClass

func GetVNFaceLandmarkRegionClass() VNFaceLandmarkRegionClass

GetVNFaceLandmarkRegionClass returns the class object for VNFaceLandmarkRegion.

func (VNFaceLandmarkRegionClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNFaceLandmarks

type VNFaceLandmarks struct {
	objectivec.Object
}

The abstract superclass for containers of face landmark information.

Overview

This class represents the set of all detectable facial landmarks and regions, exposed as properties.

Determining Accuracy

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks

func NewVNFaceLandmarks

func NewVNFaceLandmarks() VNFaceLandmarks

NewVNFaceLandmarks creates a new VNFaceLandmarks instance.

func VNFaceLandmarksFromID

func VNFaceLandmarksFromID(id objc.ID) VNFaceLandmarks

VNFaceLandmarksFromID constructs a VNFaceLandmarks from an objc.ID.

The abstract superclass for containers of face landmark information.

func (VNFaceLandmarks) Autorelease

func (f VNFaceLandmarks) Autorelease() VNFaceLandmarks

Autorelease adds the receiver to the current autorelease pool.

func (VNFaceLandmarks) Confidence

func (f VNFaceLandmarks) Confidence() VNConfidence

A confidence estimate for the detected landmarks.

Discussion

A value of `0` indicates no confidence. A value of `1` indicates full confidence.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks/confidence

func (VNFaceLandmarks) EncodeWithCoder

func (f VNFaceLandmarks) EncodeWithCoder(coder foundation.INSCoder)

func (VNFaceLandmarks) Init

Init initializes the instance.

func (VNFaceLandmarks) Landmarks

func (f VNFaceLandmarks) Landmarks() IVNFaceLandmarks2D

The facial features of the detected face.

See: https://developer.apple.com/documentation/vision/vnfaceobservation/landmarks

func (VNFaceLandmarks) RequestRevision

func (f VNFaceLandmarks) RequestRevision() uint

The revision of the VNRequest subclass used to generate the implementing object.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision

func (VNFaceLandmarks) SetLandmarks

func (f VNFaceLandmarks) SetLandmarks(value IVNFaceLandmarks2D)

type VNFaceLandmarks2D

type VNFaceLandmarks2D struct {
	VNFaceLandmarks
}

A collection of facial features that a request detects.

Overview

This class represents the set of all detectable 2D face landmarks and regions, exposed as properties. The coordinates of the face landmarks are normalized to the dimensions of the face observation’s VNFaceLandmarks2D.BoundingBox, with the origin at the bounding box’s lower-left corner. Use the VNImagePointForFaceLandmarkPoint function to convert normalized face landmark points into absolute points within the image’s coordinate system.

Face Landmark Points

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D

func NewVNFaceLandmarks2D

func NewVNFaceLandmarks2D() VNFaceLandmarks2D

NewVNFaceLandmarks2D creates a new VNFaceLandmarks2D instance.

func VNFaceLandmarks2DFromID

func VNFaceLandmarks2DFromID(id objc.ID) VNFaceLandmarks2D

VNFaceLandmarks2DFromID constructs a VNFaceLandmarks2D from an objc.ID.

A collection of facial features that a request detects.

func (VNFaceLandmarks2D) AllPoints

The region containing all face landmark points.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/allPoints

func (VNFaceLandmarks2D) Autorelease

func (f VNFaceLandmarks2D) Autorelease() VNFaceLandmarks2D

Autorelease adds the receiver to the current autorelease pool.

func (VNFaceLandmarks2D) BoundingBox

func (f VNFaceLandmarks2D) BoundingBox() corefoundation.CGRect

The bounding box of the object that the request detects.

See: https://developer.apple.com/documentation/vision/vndetectedobjectobservation/boundingbox

func (VNFaceLandmarks2D) EncodeWithCoder

func (f VNFaceLandmarks2D) EncodeWithCoder(coder foundation.INSCoder)

func (VNFaceLandmarks2D) FaceContour

The region containing points that trace the face contour from the left cheek, over the chin, to the right cheek.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/faceContour

func (VNFaceLandmarks2D) Init

Init initializes the instance.

func (VNFaceLandmarks2D) InnerLips

The region containing points that outline the space between the lips.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/innerLips

func (VNFaceLandmarks2D) LeftEye

The region containing points that outline the left eye.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/leftEye

func (VNFaceLandmarks2D) LeftEyebrow

The region containing points that trace the left eyebrow.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/leftEyebrow

func (VNFaceLandmarks2D) LeftPupil

The region containing the point where the left pupil is located.

Discussion

This value may be inaccurate if the eye is blinking.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/leftPupil

func (VNFaceLandmarks2D) MedianLine

The region containing points that trace a vertical line down the center of the face.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/medianLine

func (VNFaceLandmarks2D) Nose

The region containing points that outline the nose.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/nose

func (VNFaceLandmarks2D) NoseCrest

The region containing points that trace the center crest of the nose.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/noseCrest

func (VNFaceLandmarks2D) OuterLips

The region containing points that outline the outside of the lips.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/outerLips

func (VNFaceLandmarks2D) RightEye

The region containing points that outline the right eye.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/rightEye

func (VNFaceLandmarks2D) RightEyebrow

func (f VNFaceLandmarks2D) RightEyebrow() IVNFaceLandmarkRegion2D

The region containing points that trace the right eyebrow.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/rightEyebrow

func (VNFaceLandmarks2D) RightPupil

The region containing the point where the right pupil is located.

Discussion

This value may be inaccurate if the eye is blinking.

See: https://developer.apple.com/documentation/Vision/VNFaceLandmarks2D/rightPupil

func (VNFaceLandmarks2D) SetBoundingBox

func (f VNFaceLandmarks2D) SetBoundingBox(value corefoundation.CGRect)

type VNFaceLandmarks2DClass

type VNFaceLandmarks2DClass struct {
	// contains filtered or unexported fields
}

func GetVNFaceLandmarks2DClass

func GetVNFaceLandmarks2DClass() VNFaceLandmarks2DClass

GetVNFaceLandmarks2DClass returns the class object for VNFaceLandmarks2D.

func (VNFaceLandmarks2DClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNFaceLandmarksClass

type VNFaceLandmarksClass struct {
	// contains filtered or unexported fields
}

func GetVNFaceLandmarksClass

func GetVNFaceLandmarksClass() VNFaceLandmarksClass

GetVNFaceLandmarksClass returns the class object for VNFaceLandmarks.

func (VNFaceLandmarksClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNFaceObservation

type VNFaceObservation struct {
	VNDetectedObjectObservation
}

Face or facial-feature information that an image analysis request detects.

Overview

This type of observation results from a VNDetectFaceRectanglesRequest. It contains information about facial landmarks and regions it finds in the image.

Identifying Landmarks

Determining Facial Orientation

See: https://developer.apple.com/documentation/Vision/VNFaceObservation

func NewFaceObservationWithBoundingBox

func NewFaceObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNFaceObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewFaceObservationWithRequestRevisionBoundingBox

func NewFaceObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNFaceObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewFaceObservationWithRequestRevisionBoundingBoxRollYawPitch

func NewFaceObservationWithRequestRevisionBoundingBoxRollYawPitch(requestRevision uint, boundingBox corefoundation.CGRect, roll foundation.NSNumber, yaw foundation.NSNumber, pitch foundation.NSNumber) VNFaceObservation

Creates an observation that contains the roll, yaw, and pitch of the face.

requestRevision: The revision of the request.

boundingBox: The bounding rectangle of the detected face landmark.

roll: The rotational angle of the face landmark around the z-axis.

yaw: The rotational angle of the face landmark around the y-axis.

pitch: The rotational angle of the face landmark around the x-axis.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/init(requestRevision:boundingBox:roll:yaw:pitch:)

func NewVNFaceObservation

func NewVNFaceObservation() VNFaceObservation

NewVNFaceObservation creates a new VNFaceObservation instance.

func VNFaceObservationFromID

func VNFaceObservationFromID(id objc.ID) VNFaceObservation

VNFaceObservationFromID constructs a VNFaceObservation from an objc.ID.

Face or facial-feature information that an image analysis request detects.

func (VNFaceObservation) Autorelease

func (f VNFaceObservation) Autorelease() VNFaceObservation

Autorelease adds the receiver to the current autorelease pool.

func (VNFaceObservation) EncodeWithCoder

func (f VNFaceObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNFaceObservation) FaceCaptureQuality

func (f VNFaceObservation) FaceCaptureQuality() foundation.NSNumber

A value that indicates the quality of the face capture.

Discussion

The capture quality of the face allows you to compare the quality of the face in terms of its capture attributes: lighting, blur, and prime positioning. Use this value to compare the capture quality of a face against other captures of the same face in a specified set.

The value of this property value ranges from `0.0` to `1.0`. Faces with quality closer to `1.0` are better lit, sharper, and more centrally positioned than faces with quality closer to `0.0`.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/faceCaptureQuality-2o4xv

func (VNFaceObservation) Init

Init initializes the instance.

func (VNFaceObservation) Landmarks

func (f VNFaceObservation) Landmarks() IVNFaceLandmarks2D

The facial features of the detected face.

Discussion

This value is `nil` for face observations produced by a VNDetectFaceRectanglesRequest analysis. Use the VNDetectFaceLandmarksRequest class to find facial features.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/landmarks

func (VNFaceObservation) Pitch

The pitch angle of a face in radians.

Discussion

This value indicates the rotational angle of the face around the x-axis.

If the request doesn’t calculate the angle, the value is `nil`.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/pitch

func (VNFaceObservation) Results

The results of the face-capture quality request.

See: https://developer.apple.com/documentation/vision/vndetectfacecapturequalityrequest/results

func (VNFaceObservation) Roll

The roll angle of a face in radians.

Discussion

This value indicates the rotational angle of the face around the z-axis.

If the request doesn’t calculate the angle, the value is `nil`.

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/roll

func (VNFaceObservation) SetResults

func (f VNFaceObservation) SetResults(value IVNFaceObservation)

func (VNFaceObservation) Yaw

The yaw angle of a face in radians.

Discussion

This value indicates the rotational angle of the face around the y-axis.

If the request doesn’t calculate the angle, the value is `nil.`

See: https://developer.apple.com/documentation/Vision/VNFaceObservation/yaw

type VNFaceObservationAccepting

type VNFaceObservationAccepting interface {
	objectivec.IObject

	// An array of [VNFaceObservation](<doc://Vision/documentation/Vision/VNFaceObservation>) objects to process as part of the request.
	//
	// See: https://developer.apple.com/documentation/Vision/VNFaceObservationAccepting/inputFaceObservations
	InputFaceObservations() []VNFaceObservation

	// An array of [VNFaceObservation](<doc://Vision/documentation/Vision/VNFaceObservation>) objects to process as part of the request.
	//
	// See: https://developer.apple.com/documentation/Vision/VNFaceObservationAccepting/inputFaceObservations
	SetInputFaceObservations(value []VNFaceObservation)
}

An image analysis request that operates on face observations.

See: https://developer.apple.com/documentation/Vision/VNFaceObservationAccepting

type VNFaceObservationAcceptingObject

type VNFaceObservationAcceptingObject struct {
	objectivec.Object
}

VNFaceObservationAcceptingObject wraps an existing Objective-C object that conforms to the VNFaceObservationAccepting protocol.

func VNFaceObservationAcceptingObjectFromID

func VNFaceObservationAcceptingObjectFromID(id objc.ID) VNFaceObservationAcceptingObject

VNFaceObservationAcceptingObjectFromID constructs a VNFaceObservationAcceptingObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (VNFaceObservationAcceptingObject) BaseObject

func (VNFaceObservationAcceptingObject) InputFaceObservations

func (o VNFaceObservationAcceptingObject) InputFaceObservations() []VNFaceObservation

func (VNFaceObservationAcceptingObject) SetInputFaceObservations

func (o VNFaceObservationAcceptingObject) SetInputFaceObservations(value []VNFaceObservation)

type VNFaceObservationClass

type VNFaceObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNFaceObservationClass

func GetVNFaceObservationClass() VNFaceObservationClass

GetVNFaceObservationClass returns the class object for VNFaceObservation.

func (VNFaceObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNFeaturePrintObservation

type VNFeaturePrintObservation struct {
	VNObservation
}

An observation that provides the recognized feature print.

Fetching Feature Print Data

Determining Types of Feature Prints

Computing Distance Between Features

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation

func NewVNFeaturePrintObservation

func NewVNFeaturePrintObservation() VNFeaturePrintObservation

NewVNFeaturePrintObservation creates a new VNFeaturePrintObservation instance.

func VNFeaturePrintObservationFromID

func VNFeaturePrintObservationFromID(id objc.ID) VNFeaturePrintObservation

VNFeaturePrintObservationFromID constructs a VNFeaturePrintObservation from an objc.ID.

An observation that provides the recognized feature print.

func (VNFeaturePrintObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNFeaturePrintObservation) ComputeDistanceToFeaturePrintObservationError

func (f VNFeaturePrintObservation) ComputeDistanceToFeaturePrintObservationError(featurePrint VNFeaturePrintObservation) (float32, error)

Computes the distance between two feature print observations.

outDistance: A pointer to store the calculated distance value.

featurePrint: The feature print object whose distance to calculate.

Discussion

Shorter distances indicate greater similarity between feature prints.

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation/computeDistance(_:to:)

func (VNFeaturePrintObservation) Data

The feature print data.

Discussion

The data is divided into separate elements. Determine the type of element using [ElementType], and the number of elements using [ElementCount].

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation/data

func (VNFeaturePrintObservation) ElementCount

func (f VNFeaturePrintObservation) ElementCount() uint

The total number of elements in the data.

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation/elementCount

func (VNFeaturePrintObservation) ElementType

func (f VNFeaturePrintObservation) ElementType() VNElementType

The type of each element in the data.

See: https://developer.apple.com/documentation/Vision/VNFeaturePrintObservation/elementType

func (VNFeaturePrintObservation) EncodeWithCoder

func (f VNFeaturePrintObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNFeaturePrintObservation) Init

Init initializes the instance.

type VNFeaturePrintObservationClass

type VNFeaturePrintObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNFeaturePrintObservationClass

func GetVNFeaturePrintObservationClass() VNFeaturePrintObservationClass

GetVNFeaturePrintObservationClass returns the class object for VNFeaturePrintObservation.

func (VNFeaturePrintObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateAttentionBasedSaliencyImageRequest

type VNGenerateAttentionBasedSaliencyImageRequest struct {
	VNImageBasedRequest
}

An object that produces a heat map that identifies the parts of an image most likely to draw attention.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGenerateAttentionBasedSaliencyImageRequest

func NewGenerateAttentionBasedSaliencyImageRequestWithCompletionHandler

func NewGenerateAttentionBasedSaliencyImageRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGenerateAttentionBasedSaliencyImageRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNGenerateAttentionBasedSaliencyImageRequest

func NewVNGenerateAttentionBasedSaliencyImageRequest() VNGenerateAttentionBasedSaliencyImageRequest

NewVNGenerateAttentionBasedSaliencyImageRequest creates a new VNGenerateAttentionBasedSaliencyImageRequest instance.

func VNGenerateAttentionBasedSaliencyImageRequestFromID

func VNGenerateAttentionBasedSaliencyImageRequestFromID(id objc.ID) VNGenerateAttentionBasedSaliencyImageRequest

VNGenerateAttentionBasedSaliencyImageRequestFromID constructs a VNGenerateAttentionBasedSaliencyImageRequest from an objc.ID.

An object that produces a heat map that identifies the parts of an image most likely to draw attention.

func (VNGenerateAttentionBasedSaliencyImageRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGenerateAttentionBasedSaliencyImageRequest) Init

Init initializes the instance.

func (VNGenerateAttentionBasedSaliencyImageRequest) VNGenerateAttentionBasedSaliencyImageRequestRevision1

func (g VNGenerateAttentionBasedSaliencyImageRequest) VNGenerateAttentionBasedSaliencyImageRequestRevision1() int

A constant for specifying revision 1 of the image saliency request.

See: https://developer.apple.com/documentation/vision/vngenerateattentionbasedsaliencyimagerequestrevision1

type VNGenerateAttentionBasedSaliencyImageRequestClass

type VNGenerateAttentionBasedSaliencyImageRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGenerateAttentionBasedSaliencyImageRequestClass

func GetVNGenerateAttentionBasedSaliencyImageRequestClass() VNGenerateAttentionBasedSaliencyImageRequestClass

GetVNGenerateAttentionBasedSaliencyImageRequestClass returns the class object for VNGenerateAttentionBasedSaliencyImageRequest.

func (VNGenerateAttentionBasedSaliencyImageRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateForegroundInstanceMaskRequest

type VNGenerateForegroundInstanceMaskRequest struct {
	VNImageBasedRequest
}

A request that generates an instance mask of noticable objects to separate from the background.

See: https://developer.apple.com/documentation/Vision/VNGenerateForegroundInstanceMaskRequest

func NewGenerateForegroundInstanceMaskRequestWithCompletionHandler

func NewGenerateForegroundInstanceMaskRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGenerateForegroundInstanceMaskRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNGenerateForegroundInstanceMaskRequest

func NewVNGenerateForegroundInstanceMaskRequest() VNGenerateForegroundInstanceMaskRequest

NewVNGenerateForegroundInstanceMaskRequest creates a new VNGenerateForegroundInstanceMaskRequest instance.

func VNGenerateForegroundInstanceMaskRequestFromID

func VNGenerateForegroundInstanceMaskRequestFromID(id objc.ID) VNGenerateForegroundInstanceMaskRequest

VNGenerateForegroundInstanceMaskRequestFromID constructs a VNGenerateForegroundInstanceMaskRequest from an objc.ID.

A request that generates an instance mask of noticable objects to separate from the background.

func (VNGenerateForegroundInstanceMaskRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGenerateForegroundInstanceMaskRequest) Init

Init initializes the instance.

func (VNGenerateForegroundInstanceMaskRequest) VNGenerateForegroundInstanceMaskRequestRevision1

func (g VNGenerateForegroundInstanceMaskRequest) VNGenerateForegroundInstanceMaskRequestRevision1() int

A constant for specifying the first revision of the foreground instance mask request.

See: https://developer.apple.com/documentation/vision/vngenerateforegroundinstancemaskrequestrevision1

type VNGenerateForegroundInstanceMaskRequestClass

type VNGenerateForegroundInstanceMaskRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGenerateForegroundInstanceMaskRequestClass

func GetVNGenerateForegroundInstanceMaskRequestClass() VNGenerateForegroundInstanceMaskRequestClass

GetVNGenerateForegroundInstanceMaskRequestClass returns the class object for VNGenerateForegroundInstanceMaskRequest.

func (VNGenerateForegroundInstanceMaskRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateImageFeaturePrintRequest

type VNGenerateImageFeaturePrintRequest struct {
	VNImageBasedRequest
}

An image-based request to generate feature prints from an image.

Overview

This request returns the feature print data it generates as an array of VNFeaturePrintObservation objects.

Scaling and Cropping Images

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGenerateImageFeaturePrintRequest

func NewGenerateImageFeaturePrintRequestWithCompletionHandler

func NewGenerateImageFeaturePrintRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGenerateImageFeaturePrintRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNGenerateImageFeaturePrintRequest

func NewVNGenerateImageFeaturePrintRequest() VNGenerateImageFeaturePrintRequest

NewVNGenerateImageFeaturePrintRequest creates a new VNGenerateImageFeaturePrintRequest instance.

func VNGenerateImageFeaturePrintRequestFromID

func VNGenerateImageFeaturePrintRequestFromID(id objc.ID) VNGenerateImageFeaturePrintRequest

VNGenerateImageFeaturePrintRequestFromID constructs a VNGenerateImageFeaturePrintRequest from an objc.ID.

An image-based request to generate feature prints from an image.

func (VNGenerateImageFeaturePrintRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGenerateImageFeaturePrintRequest) ImageCropAndScaleOption

An optional setting that tells the algorithm how to scale an input image before generating the feature print.

Discussion

Scaling is applied before generating the feature print. The default value is [ImageCropAndScaleOptionScaleFill].

Scaling an image ensures that the entire image fits into the algorithm’s input image dimensions, which may require a change in aspect ratio. Each crop and scale option transforms the input image in a different way:

[scale-crop-options]

See: https://developer.apple.com/documentation/Vision/VNGenerateImageFeaturePrintRequest/imageCropAndScaleOption

func (VNGenerateImageFeaturePrintRequest) Init

Init initializes the instance.

func (VNGenerateImageFeaturePrintRequest) SetImageCropAndScaleOption

func (g VNGenerateImageFeaturePrintRequest) SetImageCropAndScaleOption(value VNImageCropAndScaleOption)

func (VNGenerateImageFeaturePrintRequest) VNGenerateImageFeaturePrintRequestRevision1

func (g VNGenerateImageFeaturePrintRequest) VNGenerateImageFeaturePrintRequestRevision1() int

A constant for specifying the first revision of the feature-print request.

See: https://developer.apple.com/documentation/vision/vngenerateimagefeatureprintrequestrevision1

type VNGenerateImageFeaturePrintRequestClass

type VNGenerateImageFeaturePrintRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGenerateImageFeaturePrintRequestClass

func GetVNGenerateImageFeaturePrintRequestClass() VNGenerateImageFeaturePrintRequestClass

GetVNGenerateImageFeaturePrintRequestClass returns the class object for VNGenerateImageFeaturePrintRequest.

func (VNGenerateImageFeaturePrintRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateObjectnessBasedSaliencyImageRequest

type VNGenerateObjectnessBasedSaliencyImageRequest struct {
	VNImageBasedRequest
}

A request that generates a heat map that identifies the parts of an image most likely to represent objects.

Overview

The resulting observation, VNSaliencyImageObservation, encodes this data as a heat map, which you can use to highlight regions of interest.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGenerateObjectnessBasedSaliencyImageRequest

func NewGenerateObjectnessBasedSaliencyImageRequestWithCompletionHandler

func NewGenerateObjectnessBasedSaliencyImageRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGenerateObjectnessBasedSaliencyImageRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNGenerateObjectnessBasedSaliencyImageRequest

func NewVNGenerateObjectnessBasedSaliencyImageRequest() VNGenerateObjectnessBasedSaliencyImageRequest

NewVNGenerateObjectnessBasedSaliencyImageRequest creates a new VNGenerateObjectnessBasedSaliencyImageRequest instance.

func VNGenerateObjectnessBasedSaliencyImageRequestFromID

func VNGenerateObjectnessBasedSaliencyImageRequestFromID(id objc.ID) VNGenerateObjectnessBasedSaliencyImageRequest

VNGenerateObjectnessBasedSaliencyImageRequestFromID constructs a VNGenerateObjectnessBasedSaliencyImageRequest from an objc.ID.

A request that generates a heat map that identifies the parts of an image most likely to represent objects.

func (VNGenerateObjectnessBasedSaliencyImageRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGenerateObjectnessBasedSaliencyImageRequest) Init

Init initializes the instance.

func (VNGenerateObjectnessBasedSaliencyImageRequest) VNGenerateObjectnessBasedSaliencyImageRequestRevision1

func (g VNGenerateObjectnessBasedSaliencyImageRequest) VNGenerateObjectnessBasedSaliencyImageRequestRevision1() int

A constant for specifying revision 1 of the image saliency request.

See: https://developer.apple.com/documentation/vision/vngenerateobjectnessbasedsaliencyimagerequestrevision1

type VNGenerateObjectnessBasedSaliencyImageRequestClass

type VNGenerateObjectnessBasedSaliencyImageRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGenerateObjectnessBasedSaliencyImageRequestClass

func GetVNGenerateObjectnessBasedSaliencyImageRequestClass() VNGenerateObjectnessBasedSaliencyImageRequestClass

GetVNGenerateObjectnessBasedSaliencyImageRequestClass returns the class object for VNGenerateObjectnessBasedSaliencyImageRequest.

func (VNGenerateObjectnessBasedSaliencyImageRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateOpticalFlowRequest

type VNGenerateOpticalFlowRequest struct {
	VNTargetedImageRequest
}

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

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.

Configuring the Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGenerateOpticalFlowRequest

func NewGenerateOpticalFlowRequestWithCompletionHandler

func NewGenerateOpticalFlowRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewGenerateOpticalFlowRequestWithTargetedCGImageOptions

func NewGenerateOpticalFlowRequestWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func NewGenerateOpticalFlowRequestWithTargetedCGImageOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func NewGenerateOpticalFlowRequestWithTargetedCGImageOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCGImageOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCIImageOptions

func NewGenerateOpticalFlowRequestWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options: ciImage is a [coreimage.CIImage].

func NewGenerateOpticalFlowRequestWithTargetedCIImageOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:) ciImage is a [coreimage.CIImage].

func NewGenerateOpticalFlowRequestWithTargetedCIImageOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options: ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCIImageOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:) ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOptions

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options: sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options: sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOptions

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedImageDataOptions

func NewGenerateOpticalFlowRequestWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func NewGenerateOpticalFlowRequestWithTargetedImageDataOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func NewGenerateOpticalFlowRequestWithTargetedImageDataOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedImageDataOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedImageURLOptions

func NewGenerateOpticalFlowRequestWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func NewGenerateOpticalFlowRequestWithTargetedImageURLOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func NewGenerateOpticalFlowRequestWithTargetedImageURLOrientationOptions

func NewGenerateOpticalFlowRequestWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNGenerateOpticalFlowRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewGenerateOpticalFlowRequestWithTargetedImageURLOrientationOptionsCompletionHandler

func NewGenerateOpticalFlowRequestWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNGenerateOpticalFlowRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNGenerateOpticalFlowRequest

func NewVNGenerateOpticalFlowRequest() VNGenerateOpticalFlowRequest

NewVNGenerateOpticalFlowRequest creates a new VNGenerateOpticalFlowRequest instance.

func VNGenerateOpticalFlowRequestFromID

func VNGenerateOpticalFlowRequestFromID(id objc.ID) VNGenerateOpticalFlowRequest

VNGenerateOpticalFlowRequestFromID constructs a VNGenerateOpticalFlowRequest from an objc.ID.

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

func (VNGenerateOpticalFlowRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGenerateOpticalFlowRequest) Init

Init initializes the instance.

func (VNGenerateOpticalFlowRequest) KeepNetworkOutput

func (g VNGenerateOpticalFlowRequest) KeepNetworkOutput() bool

A Boolean value that indicates whether to keep the raw pixel buffer coming from the machine learning network.

Discussion

The default is false. When you set this to true, the system ignores [OutputPixelFormat]. Setting this for revision 1 has no effect because it’s not machine learning-based.

See: https://developer.apple.com/documentation/Vision/VNGenerateOpticalFlowRequest/keepNetworkOutput

func (VNGenerateOpticalFlowRequest) OutputPixelFormat

func (g VNGenerateOpticalFlowRequest) OutputPixelFormat() uint32

The output buffer’s pixel format.

See: https://developer.apple.com/documentation/Vision/VNGenerateOpticalFlowRequest/outputPixelFormat

func (VNGenerateOpticalFlowRequest) SetComputationAccuracy

func (VNGenerateOpticalFlowRequest) SetKeepNetworkOutput

func (g VNGenerateOpticalFlowRequest) SetKeepNetworkOutput(value bool)

func (VNGenerateOpticalFlowRequest) SetOutputPixelFormat

func (g VNGenerateOpticalFlowRequest) SetOutputPixelFormat(value uint32)

func (VNGenerateOpticalFlowRequest) VNGenerateOpticalFlowRequestRevision1

func (g VNGenerateOpticalFlowRequest) VNGenerateOpticalFlowRequestRevision1() int

A constant for specifying revision 1 of the optical flow generation request.

See: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequestrevision1

func (VNGenerateOpticalFlowRequest) VNGenerateOpticalFlowRequestRevision2

func (g VNGenerateOpticalFlowRequest) VNGenerateOpticalFlowRequestRevision2() int

A constant for specifying revision 2 of the optical flow generation request.

See: https://developer.apple.com/documentation/vision/vngenerateopticalflowrequestrevision2

type VNGenerateOpticalFlowRequestClass

type VNGenerateOpticalFlowRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGenerateOpticalFlowRequestClass

func GetVNGenerateOpticalFlowRequestClass() VNGenerateOpticalFlowRequestClass

GetVNGenerateOpticalFlowRequestClass returns the class object for VNGenerateOpticalFlowRequest.

func (VNGenerateOpticalFlowRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGenerateOpticalFlowRequestComputationAccuracy

type VNGenerateOpticalFlowRequestComputationAccuracy int

See: https://developer.apple.com/documentation/Vision/VNGenerateOpticalFlowRequest/ComputationAccuracy-swift.enum

const (
	// VNGenerateOpticalFlowRequestComputationAccuracyHigh: High accuracy.
	VNGenerateOpticalFlowRequestComputationAccuracyHigh VNGenerateOpticalFlowRequestComputationAccuracy = 2
	// VNGenerateOpticalFlowRequestComputationAccuracyLow: Low accuracy.
	VNGenerateOpticalFlowRequestComputationAccuracyLow VNGenerateOpticalFlowRequestComputationAccuracy = 0
	// VNGenerateOpticalFlowRequestComputationAccuracyMedium: Medium accuracy.
	VNGenerateOpticalFlowRequestComputationAccuracyMedium VNGenerateOpticalFlowRequestComputationAccuracy = 1
	// VNGenerateOpticalFlowRequestComputationAccuracyVeryHigh: Very high accuracy.
	VNGenerateOpticalFlowRequestComputationAccuracyVeryHigh VNGenerateOpticalFlowRequestComputationAccuracy = 3
)

func (VNGenerateOpticalFlowRequestComputationAccuracy) String

type VNGeneratePersonInstanceMaskRequest

type VNGeneratePersonInstanceMaskRequest struct {
	VNImageBasedRequest
}

An object that produces a mask of individual people it finds in the input image.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonInstanceMaskRequest

func NewGeneratePersonInstanceMaskRequestWithCompletionHandler

func NewGeneratePersonInstanceMaskRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGeneratePersonInstanceMaskRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNGeneratePersonInstanceMaskRequest

func NewVNGeneratePersonInstanceMaskRequest() VNGeneratePersonInstanceMaskRequest

NewVNGeneratePersonInstanceMaskRequest creates a new VNGeneratePersonInstanceMaskRequest instance.

func VNGeneratePersonInstanceMaskRequestFromID

func VNGeneratePersonInstanceMaskRequestFromID(id objc.ID) VNGeneratePersonInstanceMaskRequest

VNGeneratePersonInstanceMaskRequestFromID constructs a VNGeneratePersonInstanceMaskRequest from an objc.ID.

An object that produces a mask of individual people it finds in the input image.

func (VNGeneratePersonInstanceMaskRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGeneratePersonInstanceMaskRequest) Init

Init initializes the instance.

func (VNGeneratePersonInstanceMaskRequest) VNGeneratePersonInstanceMaskRequestRevision1

func (g VNGeneratePersonInstanceMaskRequest) VNGeneratePersonInstanceMaskRequestRevision1() int

A constant for specifying revision 1 of the person instance mask request.

See: https://developer.apple.com/documentation/vision/vngeneratepersoninstancemaskrequestrevision1

type VNGeneratePersonInstanceMaskRequestClass

type VNGeneratePersonInstanceMaskRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGeneratePersonInstanceMaskRequestClass

func GetVNGeneratePersonInstanceMaskRequestClass() VNGeneratePersonInstanceMaskRequestClass

GetVNGeneratePersonInstanceMaskRequestClass returns the class object for VNGeneratePersonInstanceMaskRequest.

func (VNGeneratePersonInstanceMaskRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGeneratePersonSegmentationRequest

type VNGeneratePersonSegmentationRequest struct {
	VNStatefulRequest
}

An object that produces a matte image for a person it finds in the input image.

Overview

Perform this request to detect and generate an image mask for a person in an image. The request returns the resulting image mask in an instance of VNPixelBufferObservation.

Configuring the Request

Getting the supported output pixel formats

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest

func NewGeneratePersonSegmentationRequestWithCompletionHandler

func NewGeneratePersonSegmentationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNGeneratePersonSegmentationRequest

Creates a generate person segmentation request with a completion handler.

completionHandler: A completion handler that processes the resuts of the request.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest/init(completionHandler:)

func NewGeneratePersonSegmentationRequestWithFrameAnalysisSpacingCompletionHandler

func NewGeneratePersonSegmentationRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNGeneratePersonSegmentationRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNGeneratePersonSegmentationRequest

func NewVNGeneratePersonSegmentationRequest() VNGeneratePersonSegmentationRequest

NewVNGeneratePersonSegmentationRequest creates a new VNGeneratePersonSegmentationRequest instance.

func VNGeneratePersonSegmentationRequestFromID

func VNGeneratePersonSegmentationRequestFromID(id objc.ID) VNGeneratePersonSegmentationRequest

VNGeneratePersonSegmentationRequestFromID constructs a VNGeneratePersonSegmentationRequest from an objc.ID.

An object that produces a matte image for a person it finds in the input image.

func (VNGeneratePersonSegmentationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNGeneratePersonSegmentationRequest) Init

Init initializes the instance.

func (VNGeneratePersonSegmentationRequest) OutputPixelFormat

func (g VNGeneratePersonSegmentationRequest) OutputPixelFormat() uint32

The pixel format of the output image.

Discussion

The property supports the following values:

- kCVPixelFormatType_OneComponent8 - kCVPixelFormatType_OneComponent16Half - kCVPixelFormatType_OneComponent32Float

The default value is kCVPixelFormatType_OneComponent8.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest/outputPixelFormat

func (VNGeneratePersonSegmentationRequest) QualityLevel

A value that indicates how the request balances accuracy and performance.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest/qualityLevel-swift.property

func (VNGeneratePersonSegmentationRequest) SetOutputPixelFormat

func (g VNGeneratePersonSegmentationRequest) SetOutputPixelFormat(value uint32)

func (VNGeneratePersonSegmentationRequest) SetQualityLevel

func (VNGeneratePersonSegmentationRequest) SupportedOutputPixelFormatsAndReturnError

func (g VNGeneratePersonSegmentationRequest) SupportedOutputPixelFormatsAndReturnError() ([]foundation.NSNumber, error)

Returns a list of output pixel formats that the request supports.

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest/supportedOutputPixelFormats()

func (VNGeneratePersonSegmentationRequest) VNGeneratePersonSegmentationRequestRevision1

func (g VNGeneratePersonSegmentationRequest) VNGeneratePersonSegmentationRequestRevision1() int

A constant for specifying revision 1 of the person segmentation generation request.

See: https://developer.apple.com/documentation/vision/vngeneratepersonsegmentationrequestrevision1

type VNGeneratePersonSegmentationRequestClass

type VNGeneratePersonSegmentationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNGeneratePersonSegmentationRequestClass

func GetVNGeneratePersonSegmentationRequestClass() VNGeneratePersonSegmentationRequestClass

GetVNGeneratePersonSegmentationRequestClass returns the class object for VNGeneratePersonSegmentationRequest.

func (VNGeneratePersonSegmentationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNGeneratePersonSegmentationRequestQualityLevel

type VNGeneratePersonSegmentationRequestQualityLevel int

See: https://developer.apple.com/documentation/Vision/VNGeneratePersonSegmentationRequest/QualityLevel-swift.enum

const (
	// VNGeneratePersonSegmentationRequestQualityLevelAccurate: Prefers image quality over performance.
	VNGeneratePersonSegmentationRequestQualityLevelAccurate VNGeneratePersonSegmentationRequestQualityLevel = 0
	// VNGeneratePersonSegmentationRequestQualityLevelBalanced: Prefers processing that balances image quality and performance.
	VNGeneratePersonSegmentationRequestQualityLevelBalanced VNGeneratePersonSegmentationRequestQualityLevel = 1
	// VNGeneratePersonSegmentationRequestQualityLevelFast: Prefers performance over image quality.
	VNGeneratePersonSegmentationRequestQualityLevelFast VNGeneratePersonSegmentationRequestQualityLevel = 2
)

func (VNGeneratePersonSegmentationRequestQualityLevel) String

type VNGeometryUtils

type VNGeometryUtils struct {
	objectivec.Object
}

Utility methods to determine the geometries of various Vision types.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils

func NewVNGeometryUtils

func NewVNGeometryUtils() VNGeometryUtils

NewVNGeometryUtils creates a new VNGeometryUtils instance.

func VNGeometryUtilsFromID

func VNGeometryUtilsFromID(id objc.ID) VNGeometryUtils

VNGeometryUtilsFromID constructs a VNGeometryUtils from an objc.ID.

Utility methods to determine the geometries of various Vision types.

func (VNGeometryUtils) Autorelease

func (g VNGeometryUtils) Autorelease() VNGeometryUtils

Autorelease adds the receiver to the current autorelease pool.

func (VNGeometryUtils) Init

Init initializes the instance.

type VNGeometryUtilsClass

type VNGeometryUtilsClass struct {
	// contains filtered or unexported fields
}

func GetVNGeometryUtilsClass

func GetVNGeometryUtilsClass() VNGeometryUtilsClass

GetVNGeometryUtilsClass returns the class object for VNGeometryUtils.

func (VNGeometryUtilsClass) Alloc

Alloc allocates memory for a new instance of the class.

func (VNGeometryUtilsClass) BoundingCircleForContourError

func (_VNGeometryUtilsClass VNGeometryUtilsClass) BoundingCircleForContourError(contour IVNContour) (VNCircle, error)

Calculates a bounding circle for the specified contour object.

contour: A contour around which to calculate the bounding circle.

Return Value

The bounding VNCircle object.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils/boundingCircle(for:)-423ll

func (VNGeometryUtilsClass) BoundingCircleForPointsError

func (_VNGeometryUtilsClass VNGeometryUtilsClass) BoundingCircleForPointsError(points []VNPoint) (VNCircle, error)

Calculates a bounding circle for the specified array of points.

points: A collection of points around which to calculate the bounding circle.

Return Value

The bounding VNCircle object.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils/boundingCircle(for:)-9dggv

func (VNGeometryUtilsClass) BoundingCircleForSIMDPointsPointCountError

func (_VNGeometryUtilsClass VNGeometryUtilsClass) BoundingCircleForSIMDPointsPointCountError(points objectivec.IObject, pointCount int) (VNCircle, error)

Calculates a bounding circle for the specified points.

points: A collection of points around which to calculate the bounding circle.

pointCount: The number of points in the `points` argument.

points is a [simd.simd_float2].

Return Value

The bounding VNCircle object.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils/boundingCircle(forSIMDPoints:pointCount:)

func (VNGeometryUtilsClass) CalculateAreaForContourOrientedAreaError

func (_VNGeometryUtilsClass VNGeometryUtilsClass) CalculateAreaForContourOrientedAreaError(contour VNContour, orientedArea bool) (float64, error)

Calculates the area for the specified contour.

area: The output parameter to populate with the calculated contour area.

contour: The contour object for which to calculate the area.

orientedArea: A Boolean value that indicates whether to calculate the signed area (positive for counterclockwise-oriented contours and negative for clockwise-oriented contours). If you specify [false], the returned area is always positive. // [false]: https://developer.apple.com/documentation/Swift/false

Discussion

Attempting to calculate the area for a contour containing random points, or with self-crossing edges, produces undefined results.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils/calculateArea(_:for:orientedArea:)

func (VNGeometryUtilsClass) CalculatePerimeterForContourError

func (_VNGeometryUtilsClass VNGeometryUtilsClass) CalculatePerimeterForContourError(contour VNContour) (float64, error)

Calculates the perimeter of a closed contour.

perimeter: The output parameter to populate with the calculated contour perimeter.

contour: The contour object for which to calculate the perimeter.

See: https://developer.apple.com/documentation/Vision/VNGeometryUtils/calculatePerimeter(_:for:)

type VNHomographicImageRegistrationRequest

type VNHomographicImageRegistrationRequest struct {
	VNImageRegistrationRequest
}

An image-analysis request that determines the perspective warp matrix necessary to align the content of two images.

Overview

Create and perform a homographic image registration request to align content in two images through a homography. A is an isomorphism of projected spaces, a bijection that maps lines to lines.

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNHomographicImageRegistrationRequest

func NewHomographicImageRegistrationRequestWithCompletionHandler

func NewHomographicImageRegistrationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewHomographicImageRegistrationRequestWithTargetedCGImageOptions

func NewHomographicImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func NewHomographicImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func NewHomographicImageRegistrationRequestWithTargetedCGImageOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCIImageOptions

func NewHomographicImageRegistrationRequestWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options: ciImage is a [coreimage.CIImage].

func NewHomographicImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:) ciImage is a [coreimage.CIImage].

func NewHomographicImageRegistrationRequestWithTargetedCIImageOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options: ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:) ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOptions

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options: sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options: sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOptions

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedImageDataOptions

func NewHomographicImageRegistrationRequestWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func NewHomographicImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func NewHomographicImageRegistrationRequestWithTargetedImageDataOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedImageURLOptions

func NewHomographicImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func NewHomographicImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func NewHomographicImageRegistrationRequestWithTargetedImageURLOrientationOptions

func NewHomographicImageRegistrationRequestWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNHomographicImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewHomographicImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler

func NewHomographicImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNHomographicImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNHomographicImageRegistrationRequest

func NewVNHomographicImageRegistrationRequest() VNHomographicImageRegistrationRequest

NewVNHomographicImageRegistrationRequest creates a new VNHomographicImageRegistrationRequest instance.

func VNHomographicImageRegistrationRequestFromID

func VNHomographicImageRegistrationRequestFromID(id objc.ID) VNHomographicImageRegistrationRequest

VNHomographicImageRegistrationRequestFromID constructs a VNHomographicImageRegistrationRequest from an objc.ID.

An image-analysis request that determines the perspective warp matrix necessary to align the content of two images.

func (VNHomographicImageRegistrationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHomographicImageRegistrationRequest) Init

Init initializes the instance.

func (VNHomographicImageRegistrationRequest) VNHomographicImageRegistrationRequestRevision1

func (h VNHomographicImageRegistrationRequest) VNHomographicImageRegistrationRequestRevision1() int

A constant for specifying revision 1 of the homographic image registration request.

See: https://developer.apple.com/documentation/vision/vnhomographicimageregistrationrequestrevision1

type VNHomographicImageRegistrationRequestClass

type VNHomographicImageRegistrationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNHomographicImageRegistrationRequestClass

func GetVNHomographicImageRegistrationRequestClass() VNHomographicImageRegistrationRequestClass

GetVNHomographicImageRegistrationRequestClass returns the class object for VNHomographicImageRegistrationRequest.

func (VNHomographicImageRegistrationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHorizonObservation

type VNHorizonObservation struct {
	VNObservation
}

The horizon angle information that an image-analysis request detects.

Overview

Instances of this class result from invoking a VNDetectHorizonRequest, and report the VNHorizonObservation.Angle and VNHorizonObservation.Transform of the horizon in an image.

Evaluating the Horizon

See: https://developer.apple.com/documentation/Vision/VNHorizonObservation

func NewVNHorizonObservation

func NewVNHorizonObservation() VNHorizonObservation

NewVNHorizonObservation creates a new VNHorizonObservation instance.

func VNHorizonObservationFromID

func VNHorizonObservationFromID(id objc.ID) VNHorizonObservation

VNHorizonObservationFromID constructs a VNHorizonObservation from an objc.ID.

The horizon angle information that an image-analysis request detects.

func (VNHorizonObservation) Angle

func (h VNHorizonObservation) Angle() float64

The angle of the observed horizon.

Discussion

Use the angle to orient the image in an upright position and make the detected horizon level.

See: https://developer.apple.com/documentation/Vision/VNHorizonObservation/angle

func (VNHorizonObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHorizonObservation) EncodeWithCoder

func (h VNHorizonObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNHorizonObservation) Init

Init initializes the instance.

func (VNHorizonObservation) Transform

The transform to apply to the detected horizon.

Discussion

Apply the transform’s inverse to orient the image in an upright position and make the detected horizon level.

See: https://developer.apple.com/documentation/Vision/VNHorizonObservation/transform

func (VNHorizonObservation) TransformForImageWidthHeight

func (h VNHorizonObservation) TransformForImageWidthHeight(width uintptr, height uintptr) corefoundation.CGAffineTransform

Creates an affine transform for the specified image width and height.

width: The width of the image.

height: The height of the image.

Return Value

An affine transform.

See: https://developer.apple.com/documentation/Vision/VNHorizonObservation/transform(forImageWidth:height:)

type VNHorizonObservationClass

type VNHorizonObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNHorizonObservationClass

func GetVNHorizonObservationClass() VNHorizonObservationClass

GetVNHorizonObservationClass returns the class object for VNHorizonObservation.

func (VNHorizonObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHumanBodyPose3DObservation

type VNHumanBodyPose3DObservation struct {
	VNRecognizedPoints3DObservation
}

An observation that provides the 3D body points the request recognizes.

Accessing Points

Getting the Joint Position

Getting the Parent Joint Name

Getting the Body Height

Getting the Camera Position

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation

func NewVNHumanBodyPose3DObservation

func NewVNHumanBodyPose3DObservation() VNHumanBodyPose3DObservation

NewVNHumanBodyPose3DObservation creates a new VNHumanBodyPose3DObservation instance.

func VNHumanBodyPose3DObservationFromID

func VNHumanBodyPose3DObservationFromID(id objc.ID) VNHumanBodyPose3DObservation

VNHumanBodyPose3DObservationFromID constructs a VNHumanBodyPose3DObservation from an objc.ID.

An observation that provides the 3D body points the request recognizes.

func (VNHumanBodyPose3DObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHumanBodyPose3DObservation) AvailableJointNames

func (h VNHumanBodyPose3DObservation) AvailableJointNames() []string

The names of the available joints in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/availableJointNames

func (VNHumanBodyPose3DObservation) AvailableJointsGroupNames

func (h VNHumanBodyPose3DObservation) AvailableJointsGroupNames() []string

The available joint group names in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/availableJointsGroupNames

func (VNHumanBodyPose3DObservation) BodyHeight

func (h VNHumanBodyPose3DObservation) BodyHeight() float32

The estimated human body height, in meters.

Discussion

The framework returns an accurate height if [HeightEstimation] is [HumanBodyPose3DObservationHeightEstimationMeasured]; otherwise, it returns a [HumanBodyPose3DObservationHeightEstimationReference] height.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/bodyHeight

func (VNHumanBodyPose3DObservation) CameraOriginMatrix

func (h VNHumanBodyPose3DObservation) CameraOriginMatrix() objectivec.IObject

A transform from the skeleton hip to the camera.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/cameraOriginMatrix

func (VNHumanBodyPose3DObservation) EncodeWithCoder

func (h VNHumanBodyPose3DObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNHumanBodyPose3DObservation) GetCameraRelativePositionForJointNameError

func (h VNHumanBodyPose3DObservation) GetCameraRelativePositionForJointNameError(modelPositionOut objectivec.IObject, jointName VNHumanBodyPose3DObservationJointName) (bool, error)

Gets a position relative to the camera for the body joint you specify.

modelPositionOut: The reference to the position.

jointName: The name of the humany body joint.

error: If an error occurs, an error object that describes the error; otherwise, `nil`.

modelPositionOut is a [simd.simd_float4x4].

Return Value

A Boolean value that indicates the success of determining the position.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/getCameraRelativePosition:forJointName:error:

func (VNHumanBodyPose3DObservation) HeightEstimation

The technique the framework uses to estimate body height.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/heightEstimation-swift.property

func (VNHumanBodyPose3DObservation) Init

Init initializes the instance.

func (VNHumanBodyPose3DObservation) ParentJointNameForJointName

Returns the parent joint of the joint name you specify.

jointName: The name of the body joint to return the parent of.

Return Value

The name of the parent joint.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/parentJointName(_:)

func (VNHumanBodyPose3DObservation) PointInImageForJointNameError

func (h VNHumanBodyPose3DObservation) PointInImageForJointNameError(jointName VNHumanBodyPose3DObservationJointName) (IVNPoint, error)

Returns a 2D point for the joint name you specify, relative to the input image.

jointName: The name of the human body joint.

Return Value

A projection of the 3D position onto the original 2D image in normalized, lower left origin coordinates.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/pointInImage(_:)

func (VNHumanBodyPose3DObservation) RecognizedPointForJointNameError

Returns the point for a joint name that the observation recognizes.

jointName: The joint name to retrieve.

Return Value

The point for the joint name.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/recognizedPoint(_:)

func (VNHumanBodyPose3DObservation) RecognizedPointsForJointsGroupNameError

func (h VNHumanBodyPose3DObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanBodyPose3DObservationJointsGroupName) (foundation.INSDictionary, error)

Returns a collection of points for the group name you specify.

jointsGroupName: The name of the human body joints group.

Return Value

A collection of points.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/recognizedPoints(_:)

type VNHumanBodyPose3DObservationClass

type VNHumanBodyPose3DObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNHumanBodyPose3DObservationClass

func GetVNHumanBodyPose3DObservationClass() VNHumanBodyPose3DObservationClass

GetVNHumanBodyPose3DObservationClass returns the class object for VNHumanBodyPose3DObservation.

func (VNHumanBodyPose3DObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHumanBodyPose3DObservationHeightEstimation

type VNHumanBodyPose3DObservationHeightEstimation int

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPose3DObservation/HeightEstimation-swift.enum

const (
	// VNHumanBodyPose3DObservationHeightEstimationMeasured: A technique that uses LiDAR depth data to measure body height, in meters.
	VNHumanBodyPose3DObservationHeightEstimationMeasured VNHumanBodyPose3DObservationHeightEstimation = 1
	// VNHumanBodyPose3DObservationHeightEstimationReference: A technique that uses a reference height.
	VNHumanBodyPose3DObservationHeightEstimationReference VNHumanBodyPose3DObservationHeightEstimation = 0
)

func (VNHumanBodyPose3DObservationHeightEstimation) String

type VNHumanBodyPose3DObservationJointName

type VNHumanBodyPose3DObservationJointName = string

type VNHumanBodyPose3DObservationJointNameValues

type VNHumanBodyPose3DObservationJointNameValues struct{}
var VNHumanBodyPose3DObservationJointNames VNHumanBodyPose3DObservationJointNameValues

VNHumanBodyPose3DObservationJointNames provides typed accessors for VNHumanBodyPose3DObservationJointName constants.

func (VNHumanBodyPose3DObservationJointNameValues) CenterHead

CenterHead returns A joint name that represents the center of the head.

func (VNHumanBodyPose3DObservationJointNameValues) CenterShoulder

CenterShoulder returns A joint name that represents the point between the shoulders.

func (VNHumanBodyPose3DObservationJointNameValues) LeftAnkle

LeftAnkle returns A joint name that represents the left ankle.

func (VNHumanBodyPose3DObservationJointNameValues) LeftElbow

LeftElbow returns A joint name that represents the left elbow.

func (VNHumanBodyPose3DObservationJointNameValues) LeftHip

LeftHip returns A joint name that represents the left hip.

func (VNHumanBodyPose3DObservationJointNameValues) LeftKnee

LeftKnee returns A joint name that represents the left knee.

func (VNHumanBodyPose3DObservationJointNameValues) LeftShoulder

LeftShoulder returns A joint name that represents the left shoulder.

func (VNHumanBodyPose3DObservationJointNameValues) LeftWrist

LeftWrist returns A joint name that represents the left wrist.

func (VNHumanBodyPose3DObservationJointNameValues) RightAnkle

RightAnkle returns A joint name that represents the right ankle.

func (VNHumanBodyPose3DObservationJointNameValues) RightElbow

RightElbow returns A joint name that represents the right elbow.

func (VNHumanBodyPose3DObservationJointNameValues) RightHip

RightHip returns A joint name that represents the right hip.

func (VNHumanBodyPose3DObservationJointNameValues) RightKnee

RightKnee returns A joint name that represents the right knee.

func (VNHumanBodyPose3DObservationJointNameValues) RightShoulder

RightShoulder returns A joint name that represents the right shoulder.

func (VNHumanBodyPose3DObservationJointNameValues) RightWrist

RightWrist returns A joint name that represents the right wrist.

func (VNHumanBodyPose3DObservationJointNameValues) Root

Root returns A joint name that represents the point between the left hip and right hip.

func (VNHumanBodyPose3DObservationJointNameValues) Spine

Spine returns A joint name that represents the spine.

func (VNHumanBodyPose3DObservationJointNameValues) TopHead

TopHead returns A joint name that represents the top of the head.

type VNHumanBodyPose3DObservationJointsGroupName

type VNHumanBodyPose3DObservationJointsGroupName = string

type VNHumanBodyPose3DObservationJointsGroupNameValues

type VNHumanBodyPose3DObservationJointsGroupNameValues struct{}
var VNHumanBodyPose3DObservationJointsGroupNames VNHumanBodyPose3DObservationJointsGroupNameValues

VNHumanBodyPose3DObservationJointsGroupNames provides typed accessors for VNHumanBodyPose3DObservationJointsGroupName constants.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) All

All returns A group name that represents all joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) Head

Head returns A group name that represents the head joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) LeftArm

LeftArm returns A group name that represents the left arm joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) LeftLeg

LeftLeg returns A group name that represents the left leg joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) RightArm

RightArm returns A group name that represents the right arm joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) RightLeg

RightLeg returns A group name that represents the right leg joints.

func (VNHumanBodyPose3DObservationJointsGroupNameValues) Torso

Torso returns A group name that represents the torso joints.

type VNHumanBodyPoseObservation

type VNHumanBodyPoseObservation struct {
	VNRecognizedPointsObservation
}

An observation that provides the body points the analysis recognized.

Accessing Points

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation

func NewVNHumanBodyPoseObservation

func NewVNHumanBodyPoseObservation() VNHumanBodyPoseObservation

NewVNHumanBodyPoseObservation creates a new VNHumanBodyPoseObservation instance.

func VNHumanBodyPoseObservationFromID

func VNHumanBodyPoseObservationFromID(id objc.ID) VNHumanBodyPoseObservation

VNHumanBodyPoseObservationFromID constructs a VNHumanBodyPoseObservation from an objc.ID.

An observation that provides the body points the analysis recognized.

func (VNHumanBodyPoseObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHumanBodyPoseObservation) AvailableJointNames

func (h VNHumanBodyPoseObservation) AvailableJointNames() []string

The names of the available joints in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation/availableJointNames

func (VNHumanBodyPoseObservation) AvailableJointsGroupNames

func (h VNHumanBodyPoseObservation) AvailableJointsGroupNames() []string

The available joint group names in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation/availableJointsGroupNames

func (VNHumanBodyPoseObservation) EncodeWithCoder

func (h VNHumanBodyPoseObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNHumanBodyPoseObservation) Init

Init initializes the instance.

func (VNHumanBodyPoseObservation) RecognizedPointForJointNameError

func (h VNHumanBodyPoseObservation) RecognizedPointForJointNameError(jointName VNHumanBodyPoseObservationJointName) (IVNRecognizedPoint, error)

Retrieves the recognized point for a joint name.

jointName: The joint name of the point to retrieve.

Return Value

The point for the joint name.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation/recognizedPoint(_:)

func (VNHumanBodyPoseObservation) RecognizedPointsForJointsGroupNameError

func (h VNHumanBodyPoseObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanBodyPoseObservationJointsGroupName) (foundation.INSDictionary, error)

Retrieves the recognized points associated with the joint group name.

jointsGroupName: The joint group name of the points to retrieve.

Return Value

The array of points associated with the joint group name.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyPoseObservation/recognizedPoints(_:)

type VNHumanBodyPoseObservationClass

type VNHumanBodyPoseObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNHumanBodyPoseObservationClass

func GetVNHumanBodyPoseObservationClass() VNHumanBodyPoseObservationClass

GetVNHumanBodyPoseObservationClass returns the class object for VNHumanBodyPoseObservation.

func (VNHumanBodyPoseObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHumanBodyPoseObservationJointName

type VNHumanBodyPoseObservationJointName = string

type VNHumanBodyPoseObservationJointNameValues

type VNHumanBodyPoseObservationJointNameValues struct{}
var VNHumanBodyPoseObservationJointNames VNHumanBodyPoseObservationJointNameValues

VNHumanBodyPoseObservationJointNames provides typed accessors for VNHumanBodyPoseObservationJointName constants.

func (VNHumanBodyPoseObservationJointNameValues) LeftAnkle

LeftAnkle returns The left ankle.

func (VNHumanBodyPoseObservationJointNameValues) LeftEar

LeftEar returns The left ear.

func (VNHumanBodyPoseObservationJointNameValues) LeftElbow

LeftElbow returns The left elbow.

func (VNHumanBodyPoseObservationJointNameValues) LeftEye

LeftEye returns The left eye.

func (VNHumanBodyPoseObservationJointNameValues) LeftHip

LeftHip returns The left hip.

func (VNHumanBodyPoseObservationJointNameValues) LeftKnee

LeftKnee returns The left knee.

func (VNHumanBodyPoseObservationJointNameValues) LeftShoulder

LeftShoulder returns The left shoulder.

func (VNHumanBodyPoseObservationJointNameValues) LeftWrist

LeftWrist returns The left wrist.

func (VNHumanBodyPoseObservationJointNameValues) Neck

Neck returns The neck.

func (VNHumanBodyPoseObservationJointNameValues) Nose

Nose returns The nose.

func (VNHumanBodyPoseObservationJointNameValues) RightAnkle

RightAnkle returns The right ankle.

func (VNHumanBodyPoseObservationJointNameValues) RightEar

RightEar returns The right ear.

func (VNHumanBodyPoseObservationJointNameValues) RightElbow

RightElbow returns The right elbow.

func (VNHumanBodyPoseObservationJointNameValues) RightEye

RightEye returns The right eye.

func (VNHumanBodyPoseObservationJointNameValues) RightHip

RightHip returns The right hip.

func (VNHumanBodyPoseObservationJointNameValues) RightKnee

RightKnee returns The right knee.

func (VNHumanBodyPoseObservationJointNameValues) RightShoulder

RightShoulder returns The right shoulder.

func (VNHumanBodyPoseObservationJointNameValues) RightWrist

RightWrist returns The right wrist.

func (VNHumanBodyPoseObservationJointNameValues) Root

Root returns The root (waist).

type VNHumanBodyPoseObservationJointsGroupName

type VNHumanBodyPoseObservationJointsGroupName = string

type VNHumanBodyPoseObservationJointsGroupNameValues

type VNHumanBodyPoseObservationJointsGroupNameValues struct{}
var VNHumanBodyPoseObservationJointsGroupNames VNHumanBodyPoseObservationJointsGroupNameValues

VNHumanBodyPoseObservationJointsGroupNames provides typed accessors for VNHumanBodyPoseObservationJointsGroupName constants.

func (VNHumanBodyPoseObservationJointsGroupNameValues) All

All returns All body point groups.

func (VNHumanBodyPoseObservationJointsGroupNameValues) Face

Face returns The face.

func (VNHumanBodyPoseObservationJointsGroupNameValues) LeftArm

LeftArm returns The left arm.

func (VNHumanBodyPoseObservationJointsGroupNameValues) LeftLeg

LeftLeg returns The left leg.

func (VNHumanBodyPoseObservationJointsGroupNameValues) RightArm

RightArm returns The right arm.

func (VNHumanBodyPoseObservationJointsGroupNameValues) RightLeg

RightLeg returns The right leg.

func (VNHumanBodyPoseObservationJointsGroupNameValues) Torso

Torso returns The torso.

type VNHumanBodyRecognizedPoint3D

type VNHumanBodyRecognizedPoint3D struct {
	VNRecognizedPoint3D
}

A recognized 3D point that includes a parent joint.

Getting the Position

Getting the Parent Joint

See: https://developer.apple.com/documentation/Vision/VNHumanBodyRecognizedPoint3D

func NewHumanBodyRecognizedPoint3DWithPosition

func NewHumanBodyRecognizedPoint3DWithPosition(position objectivec.IObject) VNHumanBodyRecognizedPoint3D

Creates a point object with the position you specify.

position: The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNPoint3D/init(position:) position is a [simd.simd_float4x4].

func NewVNHumanBodyRecognizedPoint3D

func NewVNHumanBodyRecognizedPoint3D() VNHumanBodyRecognizedPoint3D

NewVNHumanBodyRecognizedPoint3D creates a new VNHumanBodyRecognizedPoint3D instance.

func VNHumanBodyRecognizedPoint3DFromID

func VNHumanBodyRecognizedPoint3DFromID(id objc.ID) VNHumanBodyRecognizedPoint3D

VNHumanBodyRecognizedPoint3DFromID constructs a VNHumanBodyRecognizedPoint3D from an objc.ID.

A recognized 3D point that includes a parent joint.

func (VNHumanBodyRecognizedPoint3D) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHumanBodyRecognizedPoint3D) EncodeWithCoder

func (h VNHumanBodyRecognizedPoint3D) EncodeWithCoder(coder foundation.INSCoder)

func (VNHumanBodyRecognizedPoint3D) Init

Init initializes the instance.

func (VNHumanBodyRecognizedPoint3D) LocalPosition

The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNHumanBodyRecognizedPoint3D/localPosition

type VNHumanBodyRecognizedPoint3DClass

type VNHumanBodyRecognizedPoint3DClass struct {
	// contains filtered or unexported fields
}

func GetVNHumanBodyRecognizedPoint3DClass

func GetVNHumanBodyRecognizedPoint3DClass() VNHumanBodyRecognizedPoint3DClass

GetVNHumanBodyRecognizedPoint3DClass returns the class object for VNHumanBodyRecognizedPoint3D.

func (VNHumanBodyRecognizedPoint3DClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHumanHandPoseObservation

type VNHumanHandPoseObservation struct {
	VNRecognizedPointsObservation
}

An observation that provides the hand points the analysis recognized.

Retrieving Points

Determining the Chirality

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation

func NewVNHumanHandPoseObservation

func NewVNHumanHandPoseObservation() VNHumanHandPoseObservation

NewVNHumanHandPoseObservation creates a new VNHumanHandPoseObservation instance.

func VNHumanHandPoseObservationFromID

func VNHumanHandPoseObservationFromID(id objc.ID) VNHumanHandPoseObservation

VNHumanHandPoseObservationFromID constructs a VNHumanHandPoseObservation from an objc.ID.

An observation that provides the hand points the analysis recognized.

func (VNHumanHandPoseObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNHumanHandPoseObservation) AvailableJointNames

func (h VNHumanHandPoseObservation) AvailableJointNames() []string

The names of the available joints in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation/availableJointNames

func (VNHumanHandPoseObservation) AvailableJointsGroupNames

func (h VNHumanHandPoseObservation) AvailableJointsGroupNames() []string

The joint group names available in the observation.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation/availableJointsGroupNames

func (VNHumanHandPoseObservation) Chirality

The chirality, or handedness, of a pose.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation/chirality

func (VNHumanHandPoseObservation) EncodeWithCoder

func (h VNHumanHandPoseObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNHumanHandPoseObservation) Init

Init initializes the instance.

func (VNHumanHandPoseObservation) RecognizedPointForJointNameError

func (h VNHumanHandPoseObservation) RecognizedPointForJointNameError(jointName VNHumanHandPoseObservationJointName) (IVNRecognizedPoint, error)

Retrieves the recognized point for a joint name.

jointName: The joint name of the point to retrieve.

Return Value

The point for the joint name.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation/recognizedPoint(_:)

func (VNHumanHandPoseObservation) RecognizedPointsForJointsGroupNameError

func (h VNHumanHandPoseObservation) RecognizedPointsForJointsGroupNameError(jointsGroupName VNHumanHandPoseObservationJointsGroupName) (foundation.INSDictionary, error)

Retrieves the recognized points associated with the joint group name.

jointsGroupName: The joint group name of the points to retrieve.

Return Value

The array of points associated with the joint group name.

See: https://developer.apple.com/documentation/Vision/VNHumanHandPoseObservation/recognizedPoints(_:)

type VNHumanHandPoseObservationClass

type VNHumanHandPoseObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNHumanHandPoseObservationClass

func GetVNHumanHandPoseObservationClass() VNHumanHandPoseObservationClass

GetVNHumanHandPoseObservationClass returns the class object for VNHumanHandPoseObservation.

func (VNHumanHandPoseObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNHumanHandPoseObservationJointName

type VNHumanHandPoseObservationJointName = string

type VNHumanHandPoseObservationJointNameValues

type VNHumanHandPoseObservationJointNameValues struct{}
var VNHumanHandPoseObservationJointNames VNHumanHandPoseObservationJointNameValues

VNHumanHandPoseObservationJointNames provides typed accessors for VNHumanHandPoseObservationJointName constants.

func (VNHumanHandPoseObservationJointNameValues) IndexDIP

IndexDIP returns The index finger’s distal interphalangeal (DIP) joint.

func (VNHumanHandPoseObservationJointNameValues) IndexMCP

IndexMCP returns The index finger’s metacarpophalangeal (MCP) joint.

func (VNHumanHandPoseObservationJointNameValues) IndexPIP

IndexPIP returns The index finger’s proximal interphalangeal (PIP) joint.

func (VNHumanHandPoseObservationJointNameValues) IndexTip

IndexTip returns The tip of the index finger.

func (VNHumanHandPoseObservationJointNameValues) LittleDIP

LittleDIP returns The little finger’s distal interphalangeal (DIP) joint.

func (VNHumanHandPoseObservationJointNameValues) LittleMCP

LittleMCP returns The little finger’s metacarpophalangeal (MCP) joint.

func (VNHumanHandPoseObservationJointNameValues) LittlePIP

LittlePIP returns The little finger’s proximal interphalangeal (PIP) joint.

func (VNHumanHandPoseObservationJointNameValues) LittleTip

LittleTip returns The tip of the little finger.

func (VNHumanHandPoseObservationJointNameValues) MiddleDIP

MiddleDIP returns The middle finger’s distal interphalangeal (DIP) joint.

func (VNHumanHandPoseObservationJointNameValues) MiddleMCP

MiddleMCP returns The middle finger’s metacarpophalangeal (MCP) joint.

func (VNHumanHandPoseObservationJointNameValues) MiddlePIP

MiddlePIP returns The middle finger’s proximal interphalangeal (PIP) joint.

func (VNHumanHandPoseObservationJointNameValues) MiddleTip

MiddleTip returns The tip of the middle finger.

func (VNHumanHandPoseObservationJointNameValues) RingDIP

RingDIP returns The ring finger’s distal interphalangeal (DIP) joint.

func (VNHumanHandPoseObservationJointNameValues) RingMCP

RingMCP returns The ring finger’s metacarpophalangeal (MCP) joint.

func (VNHumanHandPoseObservationJointNameValues) RingPIP

RingPIP returns The ring finger’s proximal interphalangeal (PIP) joint.

func (VNHumanHandPoseObservationJointNameValues) RingTip

RingTip returns The tip of the ring finger.

func (VNHumanHandPoseObservationJointNameValues) ThumbCMC

ThumbCMC returns The thumb’s carpometacarpal (CMC) joint.

func (VNHumanHandPoseObservationJointNameValues) ThumbIP

ThumbIP returns The thumb’s interphalangeal (IP) joint.

func (VNHumanHandPoseObservationJointNameValues) ThumbMP

ThumbMP returns The thumb’s metacarpophalangeal (MP) joint.

func (VNHumanHandPoseObservationJointNameValues) ThumbTip

ThumbTip returns The tip of the thumb.

func (VNHumanHandPoseObservationJointNameValues) Wrist

Wrist returns The wrist.

type VNHumanHandPoseObservationJointsGroupName

type VNHumanHandPoseObservationJointsGroupName = string

type VNHumanHandPoseObservationJointsGroupNameValues

type VNHumanHandPoseObservationJointsGroupNameValues struct{}
var VNHumanHandPoseObservationJointsGroupNames VNHumanHandPoseObservationJointsGroupNameValues

VNHumanHandPoseObservationJointsGroupNames provides typed accessors for VNHumanHandPoseObservationJointsGroupName constants.

func (VNHumanHandPoseObservationJointsGroupNameValues) All

All returns All hand group names.

func (VNHumanHandPoseObservationJointsGroupNameValues) IndexFinger

IndexFinger returns The index finger.

func (VNHumanHandPoseObservationJointsGroupNameValues) LittleFinger

LittleFinger returns The little finger.

func (VNHumanHandPoseObservationJointsGroupNameValues) MiddleFinger

MiddleFinger returns The middle finger.

func (VNHumanHandPoseObservationJointsGroupNameValues) RingFinger

RingFinger returns The ring finger.

func (VNHumanHandPoseObservationJointsGroupNameValues) Thumb

Thumb returns The thumb.

type VNHumanObservation

type VNHumanObservation struct {
	VNDetectedObjectObservation
}

An object that represents a person that the request detects.

Inspecting the Observation

See: https://developer.apple.com/documentation/Vision/VNHumanObservation

func NewHumanObservationWithBoundingBox

func NewHumanObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNHumanObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewHumanObservationWithRequestRevisionBoundingBox

func NewHumanObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNHumanObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNHumanObservation

func NewVNHumanObservation() VNHumanObservation

NewVNHumanObservation creates a new VNHumanObservation instance.

func VNHumanObservationFromID

func VNHumanObservationFromID(id objc.ID) VNHumanObservation

VNHumanObservationFromID constructs a VNHumanObservation from an objc.ID.

An object that represents a person that the request detects.

func (VNHumanObservation) Autorelease

func (h VNHumanObservation) Autorelease() VNHumanObservation

Autorelease adds the receiver to the current autorelease pool.

func (VNHumanObservation) EncodeWithCoder

func (h VNHumanObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNHumanObservation) Init

Init initializes the instance.

func (VNHumanObservation) UpperBodyOnly

func (h VNHumanObservation) UpperBodyOnly() bool

A Boolean value that indicates whether the observation represents an upper-body or full-body rectangle.

See: https://developer.apple.com/documentation/Vision/VNHumanObservation/upperBodyOnly

type VNHumanObservationClass

type VNHumanObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNHumanObservationClass

func GetVNHumanObservationClass() VNHumanObservationClass

GetVNHumanObservationClass returns the class object for VNHumanObservation.

func (VNHumanObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageAestheticsScoresObservation

type VNImageAestheticsScoresObservation struct {
	VNObservation
}

An object that represents the overall score of aesthetic attributes for an image.

Parsing Observation Content

See: https://developer.apple.com/documentation/Vision/VNImageAestheticsScoresObservation

func NewVNImageAestheticsScoresObservation

func NewVNImageAestheticsScoresObservation() VNImageAestheticsScoresObservation

NewVNImageAestheticsScoresObservation creates a new VNImageAestheticsScoresObservation instance.

func VNImageAestheticsScoresObservationFromID

func VNImageAestheticsScoresObservationFromID(id objc.ID) VNImageAestheticsScoresObservation

VNImageAestheticsScoresObservationFromID constructs a VNImageAestheticsScoresObservation from an objc.ID.

An object that represents the overall score of aesthetic attributes for an image.

func (VNImageAestheticsScoresObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageAestheticsScoresObservation) EncodeWithCoder

func (i VNImageAestheticsScoresObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNImageAestheticsScoresObservation) Init

Init initializes the instance.

func (VNImageAestheticsScoresObservation) IsUtility

A Boolean value that represents images that are not necessarily of poor image quality, but may not have memorable or exciting content.

See: https://developer.apple.com/documentation/Vision/VNImageAestheticsScoresObservation/isUtility

func (VNImageAestheticsScoresObservation) OverallScore

A score which incorporates aesthetic score, failure score, and utility labels.

Discussion

This returns a value within the range of `-1` and `1`, where `-1` is least desirable and `1` is most desirable.

See: https://developer.apple.com/documentation/Vision/VNImageAestheticsScoresObservation/overallScore

func (VNImageAestheticsScoresObservation) SetResults

type VNImageAestheticsScoresObservationClass

type VNImageAestheticsScoresObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNImageAestheticsScoresObservationClass

func GetVNImageAestheticsScoresObservationClass() VNImageAestheticsScoresObservationClass

GetVNImageAestheticsScoresObservationClass returns the class object for VNImageAestheticsScoresObservation.

func (VNImageAestheticsScoresObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageAlignmentObservation

type VNImageAlignmentObservation struct {
	VNObservation
}

The abstract superclass for image-analysis results that describe the relative alignment of two images.

Overview

This abstract superclass forms the basis of image alignment or registration output. You receive its subclasses, such as VNImageTranslationAlignmentObservation and VNImageHomographicAlignmentObservation, by performing specific registration requests. Don’t create one of these classes yourself.

See: https://developer.apple.com/documentation/Vision/VNImageAlignmentObservation

func NewVNImageAlignmentObservation

func NewVNImageAlignmentObservation() VNImageAlignmentObservation

NewVNImageAlignmentObservation creates a new VNImageAlignmentObservation instance.

func VNImageAlignmentObservationFromID

func VNImageAlignmentObservationFromID(id objc.ID) VNImageAlignmentObservation

VNImageAlignmentObservationFromID constructs a VNImageAlignmentObservation from an objc.ID.

The abstract superclass for image-analysis results that describe the relative alignment of two images.

func (VNImageAlignmentObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageAlignmentObservation) EncodeWithCoder

func (i VNImageAlignmentObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNImageAlignmentObservation) Init

Init initializes the instance.

type VNImageAlignmentObservationClass

type VNImageAlignmentObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNImageAlignmentObservationClass

func GetVNImageAlignmentObservationClass() VNImageAlignmentObservationClass

GetVNImageAlignmentObservationClass returns the class object for VNImageAlignmentObservation.

func (VNImageAlignmentObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageBasedRequest

type VNImageBasedRequest struct {
	VNRequest
}

The abstract superclass for image-analysis requests that focus on a specific part of an image.

Overview

Other Vision request handlers that operate on still images inherit from this abstract base class. Don’t use it directly.

Configuring a Request

See: https://developer.apple.com/documentation/Vision/VNImageBasedRequest

func NewImageBasedRequestWithCompletionHandler

func NewImageBasedRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNImageBasedRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNImageBasedRequest

func NewVNImageBasedRequest() VNImageBasedRequest

NewVNImageBasedRequest creates a new VNImageBasedRequest instance.

func VNImageBasedRequestFromID

func VNImageBasedRequestFromID(id objc.ID) VNImageBasedRequest

VNImageBasedRequestFromID constructs a VNImageBasedRequest from an objc.ID.

The abstract superclass for image-analysis requests that focus on a specific part of an image.

func (VNImageBasedRequest) Autorelease

func (i VNImageBasedRequest) Autorelease() VNImageBasedRequest

Autorelease adds the receiver to the current autorelease pool.

func (VNImageBasedRequest) Init

Init initializes the instance.

func (VNImageBasedRequest) RegionOfInterest

func (i VNImageBasedRequest) RegionOfInterest() corefoundation.CGRect

The region of the image in which Vision will perform the request.

Discussion

The rectangle is normalized to the dimensions of the processed image. Its origin is specified relative to the image’s lower-left corner.

The default value is `{ { 0, 0 }, { 1, 1 } }`.

See: https://developer.apple.com/documentation/Vision/VNImageBasedRequest/regionOfInterest

func (VNImageBasedRequest) SetRegionOfInterest

func (i VNImageBasedRequest) SetRegionOfInterest(value corefoundation.CGRect)

type VNImageBasedRequestClass

type VNImageBasedRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNImageBasedRequestClass

func GetVNImageBasedRequestClass() VNImageBasedRequestClass

GetVNImageBasedRequestClass returns the class object for VNImageBasedRequest.

func (VNImageBasedRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageCropAndScaleOption

type VNImageCropAndScaleOption int

See: https://developer.apple.com/documentation/Vision/VNImageCropAndScaleOption

const (
	// VNImageCropAndScaleOptionCenterCrop: An option that scales the image to fit its shorter side within the input dimensions, while preserving its aspect ratio, and center-crops the image.
	VNImageCropAndScaleOptionCenterCrop VNImageCropAndScaleOption = 0
	// VNImageCropAndScaleOptionScaleFill: An option that scales the image to fill the input dimensions, resizing it if necessary.
	VNImageCropAndScaleOptionScaleFill VNImageCropAndScaleOption = 2
	// VNImageCropAndScaleOptionScaleFillRotate90CCW: An option that rotates the image 90 degrees counterclockwise and then scales it to fill the input dimensions.
	VNImageCropAndScaleOptionScaleFillRotate90CCW VNImageCropAndScaleOption = 256
	// VNImageCropAndScaleOptionScaleFit: An option that scales the image to fit its longer side within the input dimensions, while preserving its aspect ratio, and center-crops the image.
	VNImageCropAndScaleOptionScaleFit VNImageCropAndScaleOption = 1
	// VNImageCropAndScaleOptionScaleFitRotate90CCW: An option that rotates the image 90 degrees counterclockwise and then scales it, while preserving its aspect ratio, to fit on the long side.
	VNImageCropAndScaleOptionScaleFitRotate90CCW VNImageCropAndScaleOption = 256
)

func (VNImageCropAndScaleOption) String

func (e VNImageCropAndScaleOption) String() string

type VNImageHomographicAlignmentObservation

type VNImageHomographicAlignmentObservation struct {
	VNImageAlignmentObservation
}

An object that represents a perspective warp transformation.

Overview

This type of observation results from a VNHomographicImageRegistrationRequest, informing the VNImageHomographicAlignmentObservation.WarpTransform performed to align the input images.

Accessing the Transform

See: https://developer.apple.com/documentation/Vision/VNImageHomographicAlignmentObservation

func NewVNImageHomographicAlignmentObservation

func NewVNImageHomographicAlignmentObservation() VNImageHomographicAlignmentObservation

NewVNImageHomographicAlignmentObservation creates a new VNImageHomographicAlignmentObservation instance.

func VNImageHomographicAlignmentObservationFromID

func VNImageHomographicAlignmentObservationFromID(id objc.ID) VNImageHomographicAlignmentObservation

VNImageHomographicAlignmentObservationFromID constructs a VNImageHomographicAlignmentObservation from an objc.ID.

An object that represents a perspective warp transformation.

func (VNImageHomographicAlignmentObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageHomographicAlignmentObservation) EncodeWithCoder

func (VNImageHomographicAlignmentObservation) Init

Init initializes the instance.

func (VNImageHomographicAlignmentObservation) WarpTransform

The warp transform matrix to morph the floating image into the reference image.

See: https://developer.apple.com/documentation/Vision/VNImageHomographicAlignmentObservation/warpTransform

type VNImageHomographicAlignmentObservationClass

type VNImageHomographicAlignmentObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNImageHomographicAlignmentObservationClass

func GetVNImageHomographicAlignmentObservationClass() VNImageHomographicAlignmentObservationClass

GetVNImageHomographicAlignmentObservationClass returns the class object for VNImageHomographicAlignmentObservation.

func (VNImageHomographicAlignmentObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageOption

type VNImageOption = string

type VNImageOptionValues

type VNImageOptionValues struct{}
var VNImageOptions VNImageOptionValues

VNImageOptions provides typed accessors for VNImageOption constants.

func (VNImageOptionValues) CIContext

func (VNImageOptionValues) CIContext() VNImageOption

CIContext returns An option key to specify the context to use in the handler’s Core Image operations.

func (VNImageOptionValues) CameraIntrinsics

func (VNImageOptionValues) CameraIntrinsics() VNImageOption

CameraIntrinsics returns An option to specify the camera intrinstics.

func (VNImageOptionValues) Properties

func (VNImageOptionValues) Properties() VNImageOption

Properties returns The dictionary from the image source that contains the metadata for algorithms like horizon detection.

type VNImageRegistrationRequest

type VNImageRegistrationRequest struct {
	VNTargetedImageRequest
}

The abstract superclass for image-analysis requests that align images according to their content.

Overview

This abstract superclass forms the basis of image alignment or registration requests. Make specific requests through one of its subclasses, VNTranslationalImageRegistrationRequest or VNHomographicImageRegistrationRequest. Don’t create an instance of this superclass yourself.

See: https://developer.apple.com/documentation/Vision/VNImageRegistrationRequest

func NewImageRegistrationRequestWithCompletionHandler

func NewImageRegistrationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewImageRegistrationRequestWithTargetedCGImageOptions

func NewImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func NewImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func NewImageRegistrationRequestWithTargetedCGImageOrientationOptions

func NewImageRegistrationRequestWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCIImageOptions

func NewImageRegistrationRequestWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options: ciImage is a [coreimage.CIImage].

func NewImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:) ciImage is a [coreimage.CIImage].

func NewImageRegistrationRequestWithTargetedCIImageOrientationOptions

func NewImageRegistrationRequestWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options: ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:) ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCMSampleBufferOptions

func NewImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options: sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions

func NewImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options: sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCVPixelBufferOptions

func NewImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func NewImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func NewImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions

func NewImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedImageDataOptions

func NewImageRegistrationRequestWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func NewImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func NewImageRegistrationRequestWithTargetedImageDataOrientationOptions

func NewImageRegistrationRequestWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedImageURLOptions

func NewImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func NewImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func NewImageRegistrationRequestWithTargetedImageURLOrientationOptions

func NewImageRegistrationRequestWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler

func NewImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNImageRegistrationRequest

func NewVNImageRegistrationRequest() VNImageRegistrationRequest

NewVNImageRegistrationRequest creates a new VNImageRegistrationRequest instance.

func VNImageRegistrationRequestFromID

func VNImageRegistrationRequestFromID(id objc.ID) VNImageRegistrationRequest

VNImageRegistrationRequestFromID constructs a VNImageRegistrationRequest from an objc.ID.

The abstract superclass for image-analysis requests that align images according to their content.

func (VNImageRegistrationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageRegistrationRequest) Init

Init initializes the instance.

type VNImageRegistrationRequestClass

type VNImageRegistrationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNImageRegistrationRequestClass

func GetVNImageRegistrationRequestClass() VNImageRegistrationRequestClass

GetVNImageRegistrationRequestClass returns the class object for VNImageRegistrationRequest.

func (VNImageRegistrationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageRequestHandler

type VNImageRequestHandler struct {
	objectivec.Object
}

An object that processes one or more image-analysis request pertaining to a single image.

Overview

Instantiate this handler to perform Vision requests on a single image. You specify the image and, optionally, a completion handler at the time of creation, and call VNImageRequestHandler.PerformRequestsError to begin executing the request.

Creating a Request Handler

Executing a Request Handler

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler

func NewImageRequestHandlerWithCGImageOptions

func NewImageRequestHandlerWithCGImageOptions(image coregraphics.CGImageRef, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on Core Graphics images.

image: A [CGImage] containing the image to be used for performing the requests. Image content is immutable. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cgImage:options:)

func NewImageRequestHandlerWithCGImageOrientationOptions

func NewImageRequestHandlerWithCGImageOrientationOptions(image coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on a Core Graphics image with known orientation.

image: A [CGImage] containing the image to be used for performing the requests. Image content is immutable. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cgImage:orientation:options:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithCIImageOptions

func NewImageRequestHandlerWithCIImageOptions(image objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on Core Image image data.

image: A [CIImage] containing the image to be used for performing the requests. Image content is immutable. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: An optional dictionary containing [properties] keys to auxiliary image data. // [properties]: https://developer.apple.com/documentation/Vision/VNImageOption/properties

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(ciImage:options:) image is a [coreimage.CIImage].

func NewImageRequestHandlerWithCIImageOrientationOptions

func NewImageRequestHandlerWithCIImageOrientationOptions(image objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on Core Image image data of a known orientation.

image: A [CIImage] containing the image to be used for performing the requests. Image content is immutable. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(ciImage:orientation:options:) image is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithCMSampleBufferDepthDataOrientationOptions

func NewImageRequestHandlerWithCMSampleBufferDepthDataOrientationOptions(sampleBuffer objectivec.IObject, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a request handler that performs requests on an image in a sample buffer that contains depth data.

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.

depthData: The depth data to associate with the image.

orientation: The EXIF orientation of the image.

options: A dictionary that specifies auxiliary information about the image.

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:depthData:orientation:options:) sampleBuffer is a [coremedia.CMSampleBufferRef]. depthData is a [avfoundation.AVDepthData]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithCMSampleBufferOptions

func NewImageRequestHandlerWithCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

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

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.

options: A dictionary that specifies auxiliary information about the image.

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:options:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewImageRequestHandlerWithCMSampleBufferOrientationOptions

func NewImageRequestHandlerWithCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

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

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

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:orientation:options:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithCVPixelBufferDepthDataOrientationOptions

func NewImageRequestHandlerWithCVPixelBufferDepthDataOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:depthData:orientation:options:) depthData is a [avfoundation.AVDepthData]. orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithCVPixelBufferOptions

func NewImageRequestHandlerWithCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler for performing requests on a Core Video pixel buffer.

pixelBuffer: A pixel buffer that contains the image to use for performing the requests. The contents can’t change for the lifetime of the request handler.

options: A dictionary that specifies auxiliary information about the image.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:options:)

func NewImageRequestHandlerWithCVPixelBufferOrientationOptions

func NewImageRequestHandlerWithCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler for performing requests on a Core Video pixel buffer of a known orientation.

pixelBuffer: A pixel buffer that contains the image to use for performing the requests. The contents can’t change for the lifetime of the request handler.

orientation: The orientation of the input image.

options: A dictionary that specifies auxiliary information about the image.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:orientation:options:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithDataOptions

func NewImageRequestHandlerWithDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on an image in a data object.

imageData: Data containing the image to be used for performing the requests. Image content is immutable.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

Discussion

The intended use cases of this type of initializer include compressed images and network downloads, where a client may receive a JPEG from a website or the cloud.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(data:options:)

func NewImageRequestHandlerWithDataOrientationOptions

func NewImageRequestHandlerWithDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on an image of known orientation.

imageData: Data containing the image to be used for performing the requests. Image content is immutable.

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

Discussion

The intended use cases of this type of initializer include compressed images and network downloads, where a client may receive a JPEG from a website or the cloud.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(data:orientation:options:) orientation is a [imageio.CGImagePropertyOrientation].

func NewImageRequestHandlerWithURLOptions

func NewImageRequestHandlerWithURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on an image at the specified URL.

imageURL: A URL pointing to the image to be used for performing the requests. The image must be in a format supported by [Image I/O]. Image content is immutable. // [Image I/O]: https://developer.apple.com/documentation/ImageIO

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(url:options:)

func NewImageRequestHandlerWithURLOrientationOptions

func NewImageRequestHandlerWithURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on an image with known orientation, at the specified URL.

imageURL: A URL pointing to the image to be used for performing the requests. The image must be in a format supported by [Image I/O]. Image content is immutable. // [Image I/O]: https://developer.apple.com/documentation/ImageIO

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(url:orientation:options:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNImageRequestHandler

func NewVNImageRequestHandler() VNImageRequestHandler

NewVNImageRequestHandler creates a new VNImageRequestHandler instance.

func VNImageRequestHandlerFromID

func VNImageRequestHandlerFromID(id objc.ID) VNImageRequestHandler

VNImageRequestHandlerFromID constructs a VNImageRequestHandler from an objc.ID.

An object that processes one or more image-analysis request pertaining to a single image.

func (VNImageRequestHandler) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageRequestHandler) Init

Init initializes the instance.

func (VNImageRequestHandler) InitWithCGImageOptions

Creates a handler to be used for performing requests on Core Graphics images.

image: A [CGImage] containing the image to be used for performing the requests. Image content is immutable. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cgImage:options:)

func (VNImageRequestHandler) InitWithCGImageOrientationOptions

func (i VNImageRequestHandler) InitWithCGImageOrientationOptions(image coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on a Core Graphics image with known orientation.

image: A [CGImage] containing the image to be used for performing the requests. Image content is immutable. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cgImage:orientation:options:)

func (VNImageRequestHandler) InitWithCIImageOptions

func (i VNImageRequestHandler) InitWithCIImageOptions(image objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on Core Image image data.

image: A [CIImage] containing the image to be used for performing the requests. Image content is immutable. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: An optional dictionary containing [properties] keys to auxiliary image data. // [properties]: https://developer.apple.com/documentation/Vision/VNImageOption/properties

image is a [coreimage.CIImage].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(ciImage:options:)

func (VNImageRequestHandler) InitWithCIImageOrientationOptions

func (i VNImageRequestHandler) InitWithCIImageOrientationOptions(image objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on Core Image image data of a known orientation.

image: A [CIImage] containing the image to be used for performing the requests. Image content is immutable. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

image is a [coreimage.CIImage].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(ciImage:orientation:options:)

func (VNImageRequestHandler) InitWithCMSampleBufferDepthDataOrientationOptions

func (i VNImageRequestHandler) InitWithCMSampleBufferDepthDataOrientationOptions(sampleBuffer objectivec.IObject, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a request handler that performs requests on an image in a sample buffer that contains depth data.

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.

depthData: The depth data to associate with the image.

orientation: The EXIF orientation of the image.

options: A dictionary that specifies auxiliary information about the image.

sampleBuffer is a [coremedia.CMSampleBufferRef].

depthData is a [avfoundation.AVDepthData].

orientation is a [imageio.CGImagePropertyOrientation].

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:depthData:orientation:options:)

func (VNImageRequestHandler) InitWithCMSampleBufferOptions

func (i VNImageRequestHandler) InitWithCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

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

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.

options: A dictionary that specifies auxiliary information about the image.

sampleBuffer is a [coremedia.CMSampleBufferRef].

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:options:)

func (VNImageRequestHandler) InitWithCMSampleBufferOrientationOptions

func (i VNImageRequestHandler) InitWithCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

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

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.

sampleBuffer is a [coremedia.CMSampleBufferRef].

orientation is a [imageio.CGImagePropertyOrientation].

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.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cmSampleBuffer:orientation:options:)

func (VNImageRequestHandler) InitWithCVPixelBufferDepthDataOrientationOptions

func (i VNImageRequestHandler) InitWithCVPixelBufferDepthDataOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, depthData objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

depthData is a [avfoundation.AVDepthData].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:depthData:orientation:options:)

func (VNImageRequestHandler) InitWithCVPixelBufferOptions

func (i VNImageRequestHandler) InitWithCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler for performing requests on a Core Video pixel buffer.

pixelBuffer: A pixel buffer that contains the image to use for performing the requests. The contents can’t change for the lifetime of the request handler.

options: A dictionary that specifies auxiliary information about the image.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:options:)

func (VNImageRequestHandler) InitWithCVPixelBufferOrientationOptions

func (i VNImageRequestHandler) InitWithCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler for performing requests on a Core Video pixel buffer of a known orientation.

pixelBuffer: A pixel buffer that contains the image to use for performing the requests. The contents can’t change for the lifetime of the request handler.

orientation: The orientation of the input image.

options: A dictionary that specifies auxiliary information about the image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(cvPixelBuffer:orientation:options:)

func (VNImageRequestHandler) InitWithDataOptions

func (i VNImageRequestHandler) InitWithDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on an image in a data object.

imageData: Data containing the image to be used for performing the requests. Image content is immutable.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

Discussion

The intended use cases of this type of initializer include compressed images and network downloads, where a client may receive a JPEG from a website or the cloud.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(data:options:)

func (VNImageRequestHandler) InitWithDataOrientationOptions

func (i VNImageRequestHandler) InitWithDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to use for performing requests on an image of known orientation.

imageData: Data containing the image to be used for performing the requests. Image content is immutable.

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

orientation is a [imageio.CGImagePropertyOrientation].

Discussion

The intended use cases of this type of initializer include compressed images and network downloads, where a client may receive a JPEG from a website or the cloud.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(data:orientation:options:)

func (VNImageRequestHandler) InitWithURLOptions

func (i VNImageRequestHandler) InitWithURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on an image at the specified URL.

imageURL: A URL pointing to the image to be used for performing the requests. The image must be in a format supported by [Image I/O]. Image content is immutable. // [Image I/O]: https://developer.apple.com/documentation/ImageIO

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(url:options:)

func (VNImageRequestHandler) InitWithURLOrientationOptions

func (i VNImageRequestHandler) InitWithURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNImageRequestHandler

Creates a handler to be used for performing requests on an image with known orientation, at the specified URL.

imageURL: A URL pointing to the image to be used for performing the requests. The image must be in a format supported by [Image I/O]. Image content is immutable. // [Image I/O]: https://developer.apple.com/documentation/ImageIO

orientation: The orientation of the input `image`.

options: An optional dictionary containing VNImageOption keys to auxiliary image data.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/init(url:orientation:options:)

func (VNImageRequestHandler) PerformRequestsError

func (i VNImageRequestHandler) PerformRequestsError(requests []VNRequest) (bool, error)

Schedules Vision requests to perform.

requests: An array of Vision requests to perform.

Discussion

The function returns after all requests have either completed or failed. Check individual requests and errors for their respective successes and failures.

See: https://developer.apple.com/documentation/Vision/VNImageRequestHandler/perform(_:)

type VNImageRequestHandlerClass

type VNImageRequestHandlerClass struct {
	// contains filtered or unexported fields
}

func GetVNImageRequestHandlerClass

func GetVNImageRequestHandlerClass() VNImageRequestHandlerClass

GetVNImageRequestHandlerClass returns the class object for VNImageRequestHandler.

func (VNImageRequestHandlerClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNImageTranslationAlignmentObservation

type VNImageTranslationAlignmentObservation struct {
	VNImageAlignmentObservation
}

Affine transform information that an image-alignment request produces.

Overview

This type of observation results from a VNTranslationalImageRegistrationRequest, informing the VNImageTranslationAlignmentObservation.AlignmentTransform performed to align the input images.

Determining Alignment

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNImageTranslationAlignmentObservation

func NewVNImageTranslationAlignmentObservation

func NewVNImageTranslationAlignmentObservation() VNImageTranslationAlignmentObservation

NewVNImageTranslationAlignmentObservation creates a new VNImageTranslationAlignmentObservation instance.

func VNImageTranslationAlignmentObservationFromID

func VNImageTranslationAlignmentObservationFromID(id objc.ID) VNImageTranslationAlignmentObservation

VNImageTranslationAlignmentObservationFromID constructs a VNImageTranslationAlignmentObservation from an objc.ID.

Affine transform information that an image-alignment request produces.

func (VNImageTranslationAlignmentObservation) AlignmentTransform

The alignment transform to align the floating image with the reference image.

See: https://developer.apple.com/documentation/Vision/VNImageTranslationAlignmentObservation/alignmentTransform

func (VNImageTranslationAlignmentObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNImageTranslationAlignmentObservation) EncodeWithCoder

func (VNImageTranslationAlignmentObservation) Init

Init initializes the instance.

func (VNImageTranslationAlignmentObservation) VNTranslationalImageRegistrationRequestRevision1

func (i VNImageTranslationAlignmentObservation) VNTranslationalImageRegistrationRequestRevision1() int

A constant for specifying revision 1 of the translational image registration request.

See: https://developer.apple.com/documentation/vision/vntranslationalimageregistrationrequestrevision1

type VNImageTranslationAlignmentObservationClass

type VNImageTranslationAlignmentObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNImageTranslationAlignmentObservationClass

func GetVNImageTranslationAlignmentObservationClass() VNImageTranslationAlignmentObservationClass

GetVNImageTranslationAlignmentObservationClass returns the class object for VNImageTranslationAlignmentObservation.

func (VNImageTranslationAlignmentObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNInstanceMaskObservation

type VNInstanceMaskObservation struct {
	VNObservation
}

An observation that contains an instance mask that labels instances in the mask.

Accessing Instances

Creating a Mask

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation

func NewVNInstanceMaskObservation

func NewVNInstanceMaskObservation() VNInstanceMaskObservation

NewVNInstanceMaskObservation creates a new VNInstanceMaskObservation instance.

func VNInstanceMaskObservationFromID

func VNInstanceMaskObservationFromID(id objc.ID) VNInstanceMaskObservation

VNInstanceMaskObservationFromID constructs a VNInstanceMaskObservation from an objc.ID.

An observation that contains an instance mask that labels instances in the mask.

func (VNInstanceMaskObservation) AllInstances

The collection that contains all instances, excluding the background.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation/allInstances

func (VNInstanceMaskObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNInstanceMaskObservation) EncodeWithCoder

func (i VNInstanceMaskObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNInstanceMaskObservation) GenerateMaskForInstancesError

func (i VNInstanceMaskObservation) GenerateMaskForInstancesError(instances foundation.NSIndexSet) (corevideo.CVImageBufferRef, error)

Creates a low-resolution mask from the instances you specify.

instances: The collection of instances.

Return Value

The pixel buffer that contains the image.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation/generateMask(forInstances:)

func (VNInstanceMaskObservation) GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError

func (i VNInstanceMaskObservation) GenerateMaskedImageOfInstancesFromRequestHandlerCroppedToInstancesExtentError(instances foundation.NSIndexSet, requestHandler IVNImageRequestHandler, cropResult bool) (corevideo.CVImageBufferRef, error)

Creates a high-resolution image where everything becomes transparent black, except for the instances you specify.

instances: The collection of instances.

requestHandler: The image request callback.

cropResult: A Boolean value that indicates whether to crop the image to the smallest rectangle that contains all instances.

Return Value

The pixel buffer that contains the image.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation/generateMaskedImage(ofInstances:from:croppedToInstancesExtent:)

func (VNInstanceMaskObservation) GenerateScaledMaskForImageForInstancesFromRequestHandlerError

func (i VNInstanceMaskObservation) GenerateScaledMaskForImageForInstancesFromRequestHandlerError(instances foundation.NSIndexSet, requestHandler IVNImageRequestHandler) (corevideo.CVImageBufferRef, error)

Creates a high-resolution mask where everything becomes transparent black, except for the instances you specify.

instances: The collection of instances.

requestHandler: The image request callback.

Return Value

The pixel buffer that contains the image.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation/generateScaledMaskForImage(forInstances:from:)

func (VNInstanceMaskObservation) Init

Init initializes the instance.

func (VNInstanceMaskObservation) InstanceMask

The resulting mask that represents all instances.

Discussion

A pixel can only correspond to one instance. A `0` represents the background, and all other values represent the indices of the instances.

See: https://developer.apple.com/documentation/Vision/VNInstanceMaskObservation/instanceMask

func (VNInstanceMaskObservation) VNGenerateForegroundInstanceMaskRequestRevision1

func (i VNInstanceMaskObservation) VNGenerateForegroundInstanceMaskRequestRevision1() int

A constant for specifying the first revision of the foreground instance mask request.

See: https://developer.apple.com/documentation/vision/vngenerateforegroundinstancemaskrequestrevision1

type VNInstanceMaskObservationClass

type VNInstanceMaskObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNInstanceMaskObservationClass

func GetVNInstanceMaskObservationClass() VNInstanceMaskObservationClass

GetVNInstanceMaskObservationClass returns the class object for VNInstanceMaskObservation.

func (VNInstanceMaskObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNObservation

type VNObservation struct {
	objectivec.Object
}

The abstract superclass for analysis results.

Overview

Observations resulting from Vision image analysis requests inherit from this abstract base class. Don’t use this abstract superclass directly.

Tracking Observations

Evaluating Observations

See: https://developer.apple.com/documentation/Vision/VNObservation

func NewVNObservation

func NewVNObservation() VNObservation

NewVNObservation creates a new VNObservation instance.

func VNObservationFromID

func VNObservationFromID(id objc.ID) VNObservation

VNObservationFromID constructs a VNObservation from an objc.ID.

The abstract superclass for analysis results.

func (VNObservation) Autorelease

func (o VNObservation) Autorelease() VNObservation

Autorelease adds the receiver to the current autorelease pool.

func (VNObservation) Confidence

func (o VNObservation) Confidence() VNConfidence

The level of confidence in the observation’s accuracy.

Discussion

The Vision framework normalizes this value to `[0.0, 1.0]` under most circumstances. A value of `0.0` indicates no confidence. A value of `1.0` indicates highest confidence, or the observation doesn’t support or assign meaning to confidence.

See: https://developer.apple.com/documentation/Vision/VNObservation/confidence

func (VNObservation) EncodeWithCoder

func (o VNObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNObservation) Init

func (o VNObservation) Init() VNObservation

Init initializes the instance.

func (VNObservation) RequestRevision

func (o VNObservation) RequestRevision() uint

The revision of the VNRequest subclass used to generate the implementing object.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision

func (VNObservation) TimeRange

func (o VNObservation) TimeRange() objectivec.IObject

The time range of the reported observation.

Discussion

When evaluating a sequence of image buffers, use this property to determine each observation’s start time and duration. If a request doesn’t support time ranges, or the time range is unknown, the value of this property is zero.

See: https://developer.apple.com/documentation/Vision/VNObservation/timeRange

func (VNObservation) Uuid

func (o VNObservation) Uuid() foundation.NSUUID

A unique identifier assigned to the Vision observation.

See: https://developer.apple.com/documentation/Vision/VNObservation/uuid

type VNObservationClass

type VNObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNObservationClass

func GetVNObservationClass() VNObservationClass

GetVNObservationClass returns the class object for VNObservation.

func (VNObservationClass) Alloc

func (vc VNObservationClass) Alloc() VNObservation

Alloc allocates memory for a new instance of the class.

type VNPixelBufferObservation

type VNPixelBufferObservation struct {
	VNObservation
}

An object that represents an image that an image-analysis request produces.

Overview

This type of observation results from performing a VNCoreMLRequest image analysis with a Core ML model that has an image-to-image processing role. For example, this observation might result from a model that analyzes the style of one image and then transfers that style to a different image.

Vision infers that an MLModel object is an image-to-image model if that model includes an image. Its VNPixelBufferObservation.ModelDescription object includes an image-typed feature description in its VNPixelBufferObservation.OutputDescriptionsByName dictionary.

Parsing Observation Content

See: https://developer.apple.com/documentation/Vision/VNPixelBufferObservation

func NewVNPixelBufferObservation

func NewVNPixelBufferObservation() VNPixelBufferObservation

NewVNPixelBufferObservation creates a new VNPixelBufferObservation instance.

func VNPixelBufferObservationFromID

func VNPixelBufferObservationFromID(id objc.ID) VNPixelBufferObservation

VNPixelBufferObservationFromID constructs a VNPixelBufferObservation from an objc.ID.

An object that represents an image that an image-analysis request produces.

func (VNPixelBufferObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNPixelBufferObservation) EncodeWithCoder

func (p VNPixelBufferObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNPixelBufferObservation) FeatureName

func (p VNPixelBufferObservation) FeatureName() string

A feature name that the CoreML model defines.

Discussion

This value is nil if the observation isn’t the result of a VNCoreMLRequest operation.

See: https://developer.apple.com/documentation/Vision/VNPixelBufferObservation/featureName

func (VNPixelBufferObservation) Init

Init initializes the instance.

func (VNPixelBufferObservation) ModelDescription

func (p VNPixelBufferObservation) ModelDescription() coreml.MLModelDescription

Model information you use at runtime during development, which Xcode also displays in its Core ML model editor view.

See: https://developer.apple.com/documentation/CoreML/MLModel/modelDescription

func (VNPixelBufferObservation) OutputDescriptionsByName

func (p VNPixelBufferObservation) OutputDescriptionsByName() coreml.MLFeatureDescription

A dictionary of output feature descriptions, which the model keys by the output’s name.

See: https://developer.apple.com/documentation/CoreML/MLModelDescription/outputDescriptionsByName

func (VNPixelBufferObservation) PixelBuffer

The image that results from a request with image output.

Discussion

VNCoreMLRequest produces observations that contain images in pixel buffer format. The confidence level is always `1.0`.

See: https://developer.apple.com/documentation/Vision/VNPixelBufferObservation/pixelBuffer

func (VNPixelBufferObservation) SetModelDescription

func (p VNPixelBufferObservation) SetModelDescription(value coreml.MLModelDescription)

func (VNPixelBufferObservation) SetOutputDescriptionsByName

func (p VNPixelBufferObservation) SetOutputDescriptionsByName(value coreml.MLFeatureDescription)

type VNPixelBufferObservationClass

type VNPixelBufferObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNPixelBufferObservationClass

func GetVNPixelBufferObservationClass() VNPixelBufferObservationClass

GetVNPixelBufferObservationClass returns the class object for VNPixelBufferObservation.

func (VNPixelBufferObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNPoint

type VNPoint struct {
	objectivec.Object
}

An immutable object that represents a single 2D point in an image.

Creating a Point

Inspecting a Point

Calculating Distance

See: https://developer.apple.com/documentation/Vision/VNPoint

func NewPointWithLocation

func NewPointWithLocation(location corefoundation.CGPoint) VNPoint

Creates a point object from the specified Core Graphics point.

location: The Core Graphics point.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(location:)

func NewPointWithXY

func NewPointWithXY(x float64, y float64) VNPoint

Creates a point object with the specified coordinates.

x: The x-coordinate value.

y: The y-coordinate value.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(x:y:)

func NewVNPoint

func NewVNPoint() VNPoint

NewVNPoint creates a new VNPoint instance.

func VNPointFromID

func VNPointFromID(id objc.ID) VNPoint

VNPointFromID constructs a VNPoint from an objc.ID.

An immutable object that represents a single 2D point in an image.

func (VNPoint) Autorelease

func (p VNPoint) Autorelease() VNPoint

Autorelease adds the receiver to the current autorelease pool.

func (VNPoint) DistanceToPoint

func (p VNPoint) DistanceToPoint(point IVNPoint) float64

Returns the distance to another point.

point: The point for which to calculate the distance.

Return Value

The calculated distance.

See: https://developer.apple.com/documentation/Vision/VNPoint/distance(_:)

func (VNPoint) EncodeWithCoder

func (p VNPoint) EncodeWithCoder(coder foundation.INSCoder)

func (VNPoint) Init

func (p VNPoint) Init() VNPoint

Init initializes the instance.

func (VNPoint) InitWithLocation

func (p VNPoint) InitWithLocation(location corefoundation.CGPoint) VNPoint

Creates a point object from the specified Core Graphics point.

location: The Core Graphics point.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(location:)

func (VNPoint) InitWithXY

func (p VNPoint) InitWithXY(x float64, y float64) VNPoint

Creates a point object with the specified coordinates.

x: The x-coordinate value.

y: The y-coordinate value.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(x:y:)

func (VNPoint) Location

func (p VNPoint) Location() corefoundation.CGPoint

The Core Graphics point for this point.

See: https://developer.apple.com/documentation/Vision/VNPoint/location

func (VNPoint) X

func (p VNPoint) X() float64

The x-coordinate.

See: https://developer.apple.com/documentation/Vision/VNPoint/x

func (VNPoint) Y

func (p VNPoint) Y() float64

The y-coordinate.

See: https://developer.apple.com/documentation/Vision/VNPoint/y

type VNPoint3D

type VNPoint3D struct {
	objectivec.Object
}

An object that represents a 3D point in an image.

Creating a Point

Getting the Position

See: https://developer.apple.com/documentation/Vision/VNPoint3D

func NewPoint3DWithPosition

func NewPoint3DWithPosition(position objectivec.IObject) VNPoint3D

Creates a point object with the position you specify.

position: The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNPoint3D/init(position:) position is a [simd.simd_float4x4].

func NewVNPoint3D

func NewVNPoint3D() VNPoint3D

NewVNPoint3D creates a new VNPoint3D instance.

func VNPoint3DFromID

func VNPoint3DFromID(id objc.ID) VNPoint3D

VNPoint3DFromID constructs a VNPoint3D from an objc.ID.

An object that represents a 3D point in an image.

func (VNPoint3D) Autorelease

func (p VNPoint3D) Autorelease() VNPoint3D

Autorelease adds the receiver to the current autorelease pool.

func (VNPoint3D) EncodeWithCoder

func (p VNPoint3D) EncodeWithCoder(coder foundation.INSCoder)

func (VNPoint3D) Init

func (p VNPoint3D) Init() VNPoint3D

Init initializes the instance.

func (VNPoint3D) InitWithPosition

func (p VNPoint3D) InitWithPosition(position objectivec.IObject) VNPoint3D

Creates a point object with the position you specify.

position: The three-dimensional position.

position is a [simd.simd_float4x4].

See: https://developer.apple.com/documentation/Vision/VNPoint3D/init(position:)

func (VNPoint3D) Position

func (p VNPoint3D) Position() objectivec.IObject

The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNPoint3D/position

type VNPoint3DClass

type VNPoint3DClass struct {
	// contains filtered or unexported fields
}

func GetVNPoint3DClass

func GetVNPoint3DClass() VNPoint3DClass

GetVNPoint3DClass returns the class object for VNPoint3D.

func (VNPoint3DClass) Alloc

func (vc VNPoint3DClass) Alloc() VNPoint3D

Alloc allocates memory for a new instance of the class.

type VNPointClass

type VNPointClass struct {
	// contains filtered or unexported fields
}

func GetVNPointClass

func GetVNPointClass() VNPointClass

GetVNPointClass returns the class object for VNPoint.

func (VNPointClass) Alloc

func (vc VNPointClass) Alloc() VNPoint

Alloc allocates memory for a new instance of the class.

func (VNPointClass) PointByApplyingVectorToPoint

func (_VNPointClass VNPointClass) PointByApplyingVectorToPoint(vector IVNVector, point IVNPoint) VNPoint

Creates a point object that’s shifted by the X and Y offsets of the specified vector.

vector: The vector to apply to offset the point.

point: The point to translate by the vector’s X and Y offsets.

See: https://developer.apple.com/documentation/Vision/VNPoint/apply(_:to:)

func (VNPointClass) ZeroPoint

func (_VNPointClass VNPointClass) ZeroPoint() VNPoint

A point object that represents the origin.

Discussion

The origin point is (0.0, 0.0).

See: https://developer.apple.com/documentation/Vision/VNPoint/zero

type VNPointsClassification

type VNPointsClassification int

See: https://developer.apple.com/documentation/Vision/VNPointsClassification

const (
	VNPointsClassificationClosedPath   VNPointsClassification = 2
	VNPointsClassificationDisconnected VNPointsClassification = 0
	VNPointsClassificationOpenPath     VNPointsClassification = 1
)

func (VNPointsClassification) String

func (e VNPointsClassification) String() string

type VNRecognizeAnimalsRequest

type VNRecognizeAnimalsRequest struct {
	VNImageBasedRequest
}

A request that recognizes animals in an image.

Overview

Use the knownAnimalIdentifiers(forRevision:) method to determine which animals the request supports.

Identifying Animals

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNRecognizeAnimalsRequest

func NewRecognizeAnimalsRequestWithCompletionHandler

func NewRecognizeAnimalsRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNRecognizeAnimalsRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNRecognizeAnimalsRequest

func NewVNRecognizeAnimalsRequest() VNRecognizeAnimalsRequest

NewVNRecognizeAnimalsRequest creates a new VNRecognizeAnimalsRequest instance.

func VNRecognizeAnimalsRequestFromID

func VNRecognizeAnimalsRequestFromID(id objc.ID) VNRecognizeAnimalsRequest

VNRecognizeAnimalsRequestFromID constructs a VNRecognizeAnimalsRequest from an objc.ID.

A request that recognizes animals in an image.

func (VNRecognizeAnimalsRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizeAnimalsRequest) Init

Init initializes the instance.

func (VNRecognizeAnimalsRequest) SupportedIdentifiersAndReturnError

func (r VNRecognizeAnimalsRequest) SupportedIdentifiersAndReturnError() ([]string, error)

Returns the identifiers of the animals that the request detects.

Return Value

The animal identifiers.

See: https://developer.apple.com/documentation/Vision/VNRecognizeAnimalsRequest/supportedIdentifiers()

func (VNRecognizeAnimalsRequest) VNRecognizeAnimalsRequestRevision1

func (r VNRecognizeAnimalsRequest) VNRecognizeAnimalsRequestRevision1() int

A constant for specifying revision 1 of the animal recognition request.

See: https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequestrevision1

func (VNRecognizeAnimalsRequest) VNRecognizeAnimalsRequestRevision2

func (r VNRecognizeAnimalsRequest) VNRecognizeAnimalsRequestRevision2() int

A constant for specifying revision 2 of the animal recognition request.

See: https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequestrevision2

type VNRecognizeAnimalsRequestClass

type VNRecognizeAnimalsRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizeAnimalsRequestClass

func GetVNRecognizeAnimalsRequestClass() VNRecognizeAnimalsRequestClass

GetVNRecognizeAnimalsRequestClass returns the class object for VNRecognizeAnimalsRequest.

func (VNRecognizeAnimalsRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizeTextRequest

type VNRecognizeTextRequest struct {
	VNImageBasedRequest
}

An image-analysis request that finds and recognizes text in an image.

Overview

By default, a text recognition request first locates all possible glyphs or characters in the input image, and then analyzes each string. To specify or limit the languages to find in the request, set the VNRecognizeTextRequest.RecognitionLanguages property to an array that contains the names of the languages of text you want to recognize. Vision returns the result of this request in a VNRecognizedTextObservation object.

Customizing Recognition Constraints

Specifying the Language

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest

func NewRecognizeTextRequestWithCompletionHandler

func NewRecognizeTextRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNRecognizeTextRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNRecognizeTextRequest

func NewVNRecognizeTextRequest() VNRecognizeTextRequest

NewVNRecognizeTextRequest creates a new VNRecognizeTextRequest instance.

func VNRecognizeTextRequestFromID

func VNRecognizeTextRequestFromID(id objc.ID) VNRecognizeTextRequest

VNRecognizeTextRequestFromID constructs a VNRecognizeTextRequest from an objc.ID.

An image-analysis request that finds and recognizes text in an image.

func (VNRecognizeTextRequest) AutomaticallyDetectsLanguage

func (r VNRecognizeTextRequest) AutomaticallyDetectsLanguage() bool

A Boolean value that indicates whether to attempt detecting the language to use the appropriate model for recognition and language correction.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/automaticallyDetectsLanguage

func (VNRecognizeTextRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizeTextRequest) CustomWords

func (r VNRecognizeTextRequest) CustomWords() []string

An array of strings to supplement the recognized languages at the word-recognition stage.

Discussion

Custom words take precedence over the standard lexicon. The request ignores this value if [UsesLanguageCorrection] is false.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/customWords

func (VNRecognizeTextRequest) Indeterminate

func (r VNRecognizeTextRequest) Indeterminate() bool

A Boolean set to true when a request can’t determine its progress in fractions completed.

Discussion

A value of true doesn’t mean that the request will run forever. Rather, it means that the nature of the request can’t be broken down into identifiable fractions to report. The [ProgressHandler] will still be called at suitable intervals.

See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding/indeterminate

func (VNRecognizeTextRequest) Init

Init initializes the instance.

func (VNRecognizeTextRequest) MinimumTextHeight

func (r VNRecognizeTextRequest) MinimumTextHeight() float32

The minimum height, relative to the image height, of the text to recognize.

Discussion

Specify a floating-point number relative to the image height. For example, to limit recognition to text that’s half of the image height, use `0.5`. Increasing the size reduces memory consumption and expedites recognition with the tradeoff of ignoring text smaller than the minimum height. The default value is 1/32, or `0.03125`.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/minimumTextHeight

func (VNRecognizeTextRequest) ProgressHandler

A block of code executed periodically during a Vision request to report progress on long-running tasks.

Discussion

The progress handler is an optional method that allows clients of the request to report progress to the user or to display partial results as they become available. The Vision framework may call this handler on a different dispatch queue from the thread on which you initiated the original request, so ensure that your handler can execute asynchronously, in a thread-safe manner.

See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding/progressHandler

func (VNRecognizeTextRequest) RecognitionLanguages

func (r VNRecognizeTextRequest) RecognitionLanguages() []string

An array of languages to detect, in priority order.

Discussion

The order of the languages in the array defines the order in which languages are used during language processing and text recognition.

Specify the languages as ISO language codes.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/recognitionLanguages

func (VNRecognizeTextRequest) RecognitionLevel

A value that determines whether the request prioritizes accuracy or speed in text recognition.

Discussion

The recognition level determines which techniques the request uses during the text recognition. Set this value to [RequestTextRecognitionLevelFast] to prioritize speed over accuracy, and to [RequestTextRecognitionLevelAccurate] for longer, more computationally intensive recognition.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/recognitionLevel

func (VNRecognizeTextRequest) SetAutomaticallyDetectsLanguage

func (r VNRecognizeTextRequest) SetAutomaticallyDetectsLanguage(value bool)

func (VNRecognizeTextRequest) SetCustomWords

func (r VNRecognizeTextRequest) SetCustomWords(value []string)

func (VNRecognizeTextRequest) SetMinimumTextHeight

func (r VNRecognizeTextRequest) SetMinimumTextHeight(value float32)

func (VNRecognizeTextRequest) SetProgressHandler

func (r VNRecognizeTextRequest) SetProgressHandler(value VNRequestProgressHandler)

func (VNRecognizeTextRequest) SetRecognitionLanguages

func (r VNRecognizeTextRequest) SetRecognitionLanguages(value []string)

func (VNRecognizeTextRequest) SetRecognitionLevel

func (r VNRecognizeTextRequest) SetRecognitionLevel(value VNRequestTextRecognitionLevel)

func (VNRecognizeTextRequest) SetUsesLanguageCorrection

func (r VNRecognizeTextRequest) SetUsesLanguageCorrection(value bool)

func (VNRecognizeTextRequest) SupportedRecognitionLanguagesAndReturnError

func (r VNRecognizeTextRequest) SupportedRecognitionLanguagesAndReturnError() ([]string, error)

Returns the identifiers of the languages that the request supports.

Return Value

The language identifiers.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/supportedRecognitionLanguages()

func (VNRecognizeTextRequest) UsesLanguageCorrection

func (r VNRecognizeTextRequest) UsesLanguageCorrection() bool

A Boolean value that indicates whether the request applies language correction during the recognition process.

Discussion

When this value is true, Vision applies language correction during the recognition process. Disabling this property returns the raw recognition results, which provides performance benefits but less accurate results.

See: https://developer.apple.com/documentation/Vision/VNRecognizeTextRequest/usesLanguageCorrection

func (VNRecognizeTextRequest) VNRecognizeTextRequestRevision1

func (r VNRecognizeTextRequest) VNRecognizeTextRequestRevision1() int

A constant for specifying revision 1 of the text recognition request.

See: https://developer.apple.com/documentation/vision/vnrecognizetextrequestrevision1

func (VNRecognizeTextRequest) VNRecognizeTextRequestRevision2

func (r VNRecognizeTextRequest) VNRecognizeTextRequestRevision2() int

A constant for specifying revision 2 of the text recognition request.

See: https://developer.apple.com/documentation/vision/vnrecognizetextrequestrevision2

func (VNRecognizeTextRequest) VNRecognizeTextRequestRevision3

func (r VNRecognizeTextRequest) VNRecognizeTextRequestRevision3() int

A constant for specifying revision 3 of the text recognition request.

See: https://developer.apple.com/documentation/vision/vnrecognizetextrequestrevision3

type VNRecognizeTextRequestClass

type VNRecognizeTextRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizeTextRequestClass

func GetVNRecognizeTextRequestClass() VNRecognizeTextRequestClass

GetVNRecognizeTextRequestClass returns the class object for VNRecognizeTextRequest.

func (VNRecognizeTextRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedObjectObservation

type VNRecognizedObjectObservation struct {
	VNDetectedObjectObservation
}

A detected object observation with an array of classification labels that classify the recognized object.

Overview

The confidence of the classifications sum up to `1.0.` Multiply the classification confidence with the confidence of this observation.

Classifying a Recognized Object

See: https://developer.apple.com/documentation/Vision/VNRecognizedObjectObservation

func NewRecognizedObjectObservationWithBoundingBox

func NewRecognizedObjectObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNRecognizedObjectObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewRecognizedObjectObservationWithRequestRevisionBoundingBox

func NewRecognizedObjectObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNRecognizedObjectObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNRecognizedObjectObservation

func NewVNRecognizedObjectObservation() VNRecognizedObjectObservation

NewVNRecognizedObjectObservation creates a new VNRecognizedObjectObservation instance.

func VNRecognizedObjectObservationFromID

func VNRecognizedObjectObservationFromID(id objc.ID) VNRecognizedObjectObservation

VNRecognizedObjectObservationFromID constructs a VNRecognizedObjectObservation from an objc.ID.

A detected object observation with an array of classification labels that classify the recognized object.

func (VNRecognizedObjectObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedObjectObservation) EncodeWithCoder

func (r VNRecognizedObjectObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedObjectObservation) Init

Init initializes the instance.

func (VNRecognizedObjectObservation) Labels

An array of observations that classify the recognized object.

See: https://developer.apple.com/documentation/Vision/VNRecognizedObjectObservation/labels

type VNRecognizedObjectObservationClass

type VNRecognizedObjectObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedObjectObservationClass

func GetVNRecognizedObjectObservationClass() VNRecognizedObjectObservationClass

GetVNRecognizedObjectObservationClass returns the class object for VNRecognizedObjectObservation.

func (VNRecognizedObjectObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedPoint

type VNRecognizedPoint struct {
	VNDetectedPoint
}

An object that represents a normalized point in an image, along with an identifier label and a confidence value.

Inspecting a Point

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint

func NewRecognizedPointWithLocation

func NewRecognizedPointWithLocation(location corefoundation.CGPoint) VNRecognizedPoint

Creates a point object from the specified Core Graphics point.

location: The Core Graphics point.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(location:)

func NewRecognizedPointWithXY

func NewRecognizedPointWithXY(x float64, y float64) VNRecognizedPoint

Creates a point object with the specified coordinates.

x: The x-coordinate value.

y: The y-coordinate value.

See: https://developer.apple.com/documentation/Vision/VNPoint/init(x:y:)

func NewVNRecognizedPoint

func NewVNRecognizedPoint() VNRecognizedPoint

NewVNRecognizedPoint creates a new VNRecognizedPoint instance.

func VNRecognizedPointFromID

func VNRecognizedPointFromID(id objc.ID) VNRecognizedPoint

VNRecognizedPointFromID constructs a VNRecognizedPoint from an objc.ID.

An object that represents a normalized point in an image, along with an identifier label and a confidence value.

func (VNRecognizedPoint) Autorelease

func (r VNRecognizedPoint) Autorelease() VNRecognizedPoint

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedPoint) EncodeWithCoder

func (r VNRecognizedPoint) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedPoint) Identifier

func (r VNRecognizedPoint) Identifier() VNRecognizedPointKey

The point’s identifier label.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint/identifier

func (VNRecognizedPoint) Init

Init initializes the instance.

type VNRecognizedPoint3D

type VNRecognizedPoint3D struct {
	VNPoint3D
}

A 3D point that includes an identifier to the point.

Getting the Identifier

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint3D

func NewRecognizedPoint3DWithPosition

func NewRecognizedPoint3DWithPosition(position objectivec.IObject) VNRecognizedPoint3D

Creates a point object with the position you specify.

position: The three-dimensional position.

See: https://developer.apple.com/documentation/Vision/VNPoint3D/init(position:) position is a [simd.simd_float4x4].

func NewVNRecognizedPoint3D

func NewVNRecognizedPoint3D() VNRecognizedPoint3D

NewVNRecognizedPoint3D creates a new VNRecognizedPoint3D instance.

func VNRecognizedPoint3DFromID

func VNRecognizedPoint3DFromID(id objc.ID) VNRecognizedPoint3D

VNRecognizedPoint3DFromID constructs a VNRecognizedPoint3D from an objc.ID.

A 3D point that includes an identifier to the point.

func (VNRecognizedPoint3D) Autorelease

func (r VNRecognizedPoint3D) Autorelease() VNRecognizedPoint3D

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedPoint3D) EncodeWithCoder

func (r VNRecognizedPoint3D) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedPoint3D) Identifier

The identifier that provides context about what kind of point the request recognizes.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoint3D/identifier

func (VNRecognizedPoint3D) Init

Init initializes the instance.

type VNRecognizedPoint3DClass

type VNRecognizedPoint3DClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedPoint3DClass

func GetVNRecognizedPoint3DClass() VNRecognizedPoint3DClass

GetVNRecognizedPoint3DClass returns the class object for VNRecognizedPoint3D.

func (VNRecognizedPoint3DClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedPointClass

type VNRecognizedPointClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedPointClass

func GetVNRecognizedPointClass() VNRecognizedPointClass

GetVNRecognizedPointClass returns the class object for VNRecognizedPoint.

func (VNRecognizedPointClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedPointGroupKey

type VNRecognizedPointGroupKey = string
var VNRecognizedPoint3DGroupKeyAll VNRecognizedPointGroupKey
var VNRecognizedPointGroupKeyAll VNRecognizedPointGroupKey

type VNRecognizedPointKey

type VNRecognizedPointKey = string

type VNRecognizedPoints3DObservation

type VNRecognizedPoints3DObservation struct {
	VNObservation
}

An observation that provides the 3D points for a request.

Inspecting the Observation

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation

func NewVNRecognizedPoints3DObservation

func NewVNRecognizedPoints3DObservation() VNRecognizedPoints3DObservation

NewVNRecognizedPoints3DObservation creates a new VNRecognizedPoints3DObservation instance.

func VNRecognizedPoints3DObservationFromID

func VNRecognizedPoints3DObservationFromID(id objc.ID) VNRecognizedPoints3DObservation

VNRecognizedPoints3DObservationFromID constructs a VNRecognizedPoints3DObservation from an objc.ID.

An observation that provides the 3D points for a request.

func (VNRecognizedPoints3DObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedPoints3DObservation) AvailableGroupKeys

func (r VNRecognizedPoints3DObservation) AvailableGroupKeys() []string

The available point group keys in the observation.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation/availableGroupKeys

func (VNRecognizedPoints3DObservation) AvailableKeys

func (r VNRecognizedPoints3DObservation) AvailableKeys() []string

The available point keys in the observation.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation/availableKeys

func (VNRecognizedPoints3DObservation) EncodeWithCoder

func (r VNRecognizedPoints3DObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedPoints3DObservation) Init

Init initializes the instance.

func (VNRecognizedPoints3DObservation) RecognizedPointForKeyError

func (r VNRecognizedPoints3DObservation) RecognizedPointForKeyError(pointKey VNRecognizedPointKey) (IVNRecognizedPoint3D, error)

Returns a point for a key you specify.

pointKey: The key of the point to retrieve.

Return Value

The point the observation associates with the key.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation/recognizedPoint(forKey:)

func (VNRecognizedPoints3DObservation) RecognizedPointsForGroupKeyError

func (r VNRecognizedPoints3DObservation) RecognizedPointsForGroupKeyError(groupKey VNRecognizedPointGroupKey) (foundation.INSDictionary, error)

Returns a point for a group key you specify.

groupKey: The group key to retrieve points for.

Return Value

A dictionary of labeled points for the group.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPoints3DObservation/recognizedPoints(forGroupKey:)

type VNRecognizedPoints3DObservationClass

type VNRecognizedPoints3DObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedPoints3DObservationClass

func GetVNRecognizedPoints3DObservationClass() VNRecognizedPoints3DObservationClass

GetVNRecognizedPoints3DObservationClass returns the class object for VNRecognizedPoints3DObservation.

func (VNRecognizedPoints3DObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedPointsObservation

type VNRecognizedPointsObservation struct {
	VNObservation
}

An observation that provides the points the analysis recognized.

Inspecting the Observation

Converting Points for Core ML

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation

func NewVNRecognizedPointsObservation

func NewVNRecognizedPointsObservation() VNRecognizedPointsObservation

NewVNRecognizedPointsObservation creates a new VNRecognizedPointsObservation instance.

func VNRecognizedPointsObservationFromID

func VNRecognizedPointsObservationFromID(id objc.ID) VNRecognizedPointsObservation

VNRecognizedPointsObservationFromID constructs a VNRecognizedPointsObservation from an objc.ID.

An observation that provides the points the analysis recognized.

func (VNRecognizedPointsObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedPointsObservation) AvailableGroupKeys

func (r VNRecognizedPointsObservation) AvailableGroupKeys() []string

The available point group keys in the observation.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation/availableGroupKeys

func (VNRecognizedPointsObservation) AvailableKeys

func (r VNRecognizedPointsObservation) AvailableKeys() []string

The available point keys in the observation.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation/availableKeys

func (VNRecognizedPointsObservation) EncodeWithCoder

func (r VNRecognizedPointsObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedPointsObservation) Init

Init initializes the instance.

func (VNRecognizedPointsObservation) KeypointsMultiArrayAndReturnError

func (r VNRecognizedPointsObservation) KeypointsMultiArrayAndReturnError() (coreml.MLMultiArray, error)

Retrieves the grouping of normalized point coordinates and confidence scores in a format compatible with Core ML.

Return Value

The key points converted to an MLMultiArray.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation/keypointsMultiArray()

func (VNRecognizedPointsObservation) RecognizedPointForKeyError

func (r VNRecognizedPointsObservation) RecognizedPointForKeyError(pointKey VNRecognizedPointKey) (IVNRecognizedPoint, error)

Retrieves a recognized point for a key.

pointKey: The key of the point to retrieve.

Return Value

The recognized point associated with the key.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation/recognizedPoint(forKey:)

func (VNRecognizedPointsObservation) RecognizedPointsForGroupKeyError

func (r VNRecognizedPointsObservation) RecognizedPointsForGroupKeyError(groupKey VNRecognizedPointGroupKey) (foundation.INSDictionary, error)

Retrieves the recognized points for a key.

groupKey: The group key to retrieve recognized points for.

Return Value

A dictionary of labeled points for the group.

See: https://developer.apple.com/documentation/Vision/VNRecognizedPointsObservation/recognizedPoints(forGroupKey:)

type VNRecognizedPointsObservationClass

type VNRecognizedPointsObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedPointsObservationClass

func GetVNRecognizedPointsObservationClass() VNRecognizedPointsObservationClass

GetVNRecognizedPointsObservationClass returns the class object for VNRecognizedPointsObservation.

func (VNRecognizedPointsObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedText

type VNRecognizedText struct {
	objectivec.Object
}

Text recognized in an image through a text recognition request.

Overview

A single VNRecognizedTextObservation can contain multiple recognized text objects—one for each candidate.

Determining Recognized Text

See: https://developer.apple.com/documentation/Vision/VNRecognizedText

func NewVNRecognizedText

func NewVNRecognizedText() VNRecognizedText

NewVNRecognizedText creates a new VNRecognizedText instance.

func VNRecognizedTextFromID

func VNRecognizedTextFromID(id objc.ID) VNRecognizedText

VNRecognizedTextFromID constructs a VNRecognizedText from an objc.ID.

Text recognized in an image through a text recognition request.

func (VNRecognizedText) Autorelease

func (r VNRecognizedText) Autorelease() VNRecognizedText

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedText) BoundingBoxForRangeError

func (r VNRecognizedText) BoundingBoxForRangeError(range_ foundation.NSRange) (IVNRectangleObservation, error)

Calculates the bounding box around the characters in the range of a string.

range: The range of the characters in the text string to draw a bounding box around.

error: An error that contains information about failed computation of the bounding box, or `nil` if no error occurred.

Discussion

Bounding boxes aren’t always an exact fit around the characters. Use them to display in user interfaces to provide general guidance, but avoid using their contents for image processing.

The bounding box that returns from this method differs based on the value of [RecognitionLevel], as follows:

[Table data omitted]

See: https://developer.apple.com/documentation/Vision/VNRecognizedText/boundingBoxForRange:error:

func (VNRecognizedText) Confidence

func (r VNRecognizedText) Confidence() VNConfidence

A normalized confidence score for the text recognition result.

Discussion

The confidence level is a normalized value between `0.0` and `1.0`, where `1.0` represents the highest confidence.

See: https://developer.apple.com/documentation/Vision/VNRecognizedText/confidence

func (VNRecognizedText) EncodeWithCoder

func (r VNRecognizedText) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedText) Init

Init initializes the instance.

func (VNRecognizedText) RequestRevision

func (r VNRecognizedText) RequestRevision() uint

The revision of the VNRequest subclass used to generate the implementing object.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision

func (VNRecognizedText) String

func (r VNRecognizedText) String() string

The top candidate for recognized text.

See: https://developer.apple.com/documentation/Vision/VNRecognizedText/string

type VNRecognizedTextClass

type VNRecognizedTextClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedTextClass

func GetVNRecognizedTextClass() VNRecognizedTextClass

GetVNRecognizedTextClass returns the class object for VNRecognizedText.

func (VNRecognizedTextClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRecognizedTextObservation

type VNRecognizedTextObservation struct {
	VNRectangleObservation
}

A request that detects and recognizes regions of text in an image.

Overview

This type of observation results from a VNRecognizeTextRequest. It contains information about both the location and content of text and glyphs that Vision recognized in the input image.

Obtaining Recognized Text

See: https://developer.apple.com/documentation/Vision/VNRecognizedTextObservation

func NewRecognizedTextObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight

func NewRecognizedTextObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight(requestRevision uint, topLeft corefoundation.CGPoint, bottomLeft corefoundation.CGPoint, bottomRight corefoundation.CGPoint, topRight corefoundation.CGPoint) VNRecognizedTextObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

bottomLeft: The lower-left corner point.

bottomRight: The lower-right corner point.

topRight: The upper-right corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:bottomLeft:bottomRight:topRight:)

func NewRecognizedTextObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft

func NewRecognizedTextObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft(requestRevision uint, topLeft corefoundation.CGPoint, topRight corefoundation.CGPoint, bottomRight corefoundation.CGPoint, bottomLeft corefoundation.CGPoint) VNRecognizedTextObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

topRight: The upper-right corner point.

bottomRight: The lower-right corner point.

bottomLeft: The lower-left corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:topRight:bottomRight:bottomLeft:)

func NewRecognizedTextObservationWithBoundingBox

func NewRecognizedTextObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNRecognizedTextObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewRecognizedTextObservationWithRequestRevisionBoundingBox

func NewRecognizedTextObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNRecognizedTextObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNRecognizedTextObservation

func NewVNRecognizedTextObservation() VNRecognizedTextObservation

NewVNRecognizedTextObservation creates a new VNRecognizedTextObservation instance.

func VNRecognizedTextObservationFromID

func VNRecognizedTextObservationFromID(id objc.ID) VNRecognizedTextObservation

VNRecognizedTextObservationFromID constructs a VNRecognizedTextObservation from an objc.ID.

A request that detects and recognizes regions of text in an image.

func (VNRecognizedTextObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRecognizedTextObservation) EncodeWithCoder

func (r VNRecognizedTextObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNRecognizedTextObservation) Init

Init initializes the instance.

func (VNRecognizedTextObservation) TopCandidates

func (r VNRecognizedTextObservation) TopCandidates(maxCandidateCount uint) []VNRecognizedText

Requests the top candidates for a recognized text string.

maxCandidateCount: The maximum number of candidates to return. This can’t exceed 10.

Return Value

An array of the top candidates, sorted by decreasing confidence score.

Discussion

This function returns no more than candidates, but it may return fewer than candidates.

See: https://developer.apple.com/documentation/Vision/VNRecognizedTextObservation/topCandidates(_:)

type VNRecognizedTextObservationClass

type VNRecognizedTextObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNRecognizedTextObservationClass

func GetVNRecognizedTextObservationClass() VNRecognizedTextObservationClass

GetVNRecognizedTextObservationClass returns the class object for VNRecognizedTextObservation.

func (VNRecognizedTextObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRectangleObservation

type VNRectangleObservation struct {
	VNDetectedObjectObservation
}

An object that represents the four vertices of a detected rectangle.

Accessing the Coordinates

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation

func NewRectangleObservationWithBoundingBox

func NewRectangleObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNRectangleObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewRectangleObservationWithRequestRevisionBoundingBox

func NewRectangleObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNRectangleObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight

func NewRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight(requestRevision uint, topLeft corefoundation.CGPoint, bottomLeft corefoundation.CGPoint, bottomRight corefoundation.CGPoint, topRight corefoundation.CGPoint) VNRectangleObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

bottomLeft: The lower-left corner point.

bottomRight: The lower-right corner point.

topRight: The upper-right corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:bottomLeft:bottomRight:topRight:)

func NewRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft

func NewRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft(requestRevision uint, topLeft corefoundation.CGPoint, topRight corefoundation.CGPoint, bottomRight corefoundation.CGPoint, bottomLeft corefoundation.CGPoint) VNRectangleObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

topRight: The upper-right corner point.

bottomRight: The lower-right corner point.

bottomLeft: The lower-left corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:topRight:bottomRight:bottomLeft:)

func NewVNRectangleObservation

func NewVNRectangleObservation() VNRectangleObservation

NewVNRectangleObservation creates a new VNRectangleObservation instance.

func VNRectangleObservationFromID

func VNRectangleObservationFromID(id objc.ID) VNRectangleObservation

VNRectangleObservationFromID constructs a VNRectangleObservation from an objc.ID.

An object that represents the four vertices of a detected rectangle.

func (VNRectangleObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNRectangleObservation) BottomLeft

The coordinates of the lower-left corner of the observation bounding box.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/bottomLeft

func (VNRectangleObservation) BottomRight

The coordinates of the lower-right corner of the observation bounding box.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/bottomRight

func (VNRectangleObservation) EncodeWithCoder

func (r VNRectangleObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNRectangleObservation) Init

Init initializes the instance.

func (VNRectangleObservation) Results

The results of a document segmentation request.

See: https://developer.apple.com/documentation/vision/vndetectdocumentsegmentationrequest/results

func (VNRectangleObservation) SetResults

func (r VNRectangleObservation) SetResults(value IVNRectangleObservation)

func (VNRectangleObservation) TopLeft

The coordinates of the upper-left corner of the observation bounding box.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/topLeft

func (VNRectangleObservation) TopRight

The coordinates of the upper-right corner of the observation bounding box.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/topRight

type VNRectangleObservationClass

type VNRectangleObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNRectangleObservationClass

func GetVNRectangleObservationClass() VNRectangleObservationClass

GetVNRectangleObservationClass returns the class object for VNRectangleObservation.

func (VNRectangleObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNRequest

type VNRequest struct {
	objectivec.Object
}

The abstract superclass for analysis requests.

Overview

Other Vision request handlers that perform image analysis inherit from this abstract base class. Instantiate one of its subclasses to perform image analysis.

Initializing a Request

Configuring a Request

Configuring the Compute Device

Canceling a Request

See: https://developer.apple.com/documentation/Vision/VNRequest

func NewRequestWithCompletionHandler

func NewRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNRequest

func NewVNRequest() VNRequest

NewVNRequest creates a new VNRequest instance.

func VNRequestFromID

func VNRequestFromID(id objc.ID) VNRequest

VNRequestFromID constructs a VNRequest from an objc.ID.

The abstract superclass for analysis requests.

func (VNRequest) Autorelease

func (r VNRequest) Autorelease() VNRequest

Autorelease adds the receiver to the current autorelease pool.

func (VNRequest) Cancel

func (r VNRequest) Cancel()

Cancels the request before it can finish executing.

See: https://developer.apple.com/documentation/Vision/VNRequest/cancel()

func (VNRequest) CompletionHandler

func (r VNRequest) CompletionHandler() VNRequestCompletionHandler

The completion handler the system invokes after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/completionHandler

func (VNRequest) ComputeDeviceForComputeStage

func (r VNRequest) ComputeDeviceForComputeStage(computeStage VNComputeStage) coreml.MLComputeDeviceProtocol

Returns the compute device for a compute stage.

computeStage: The compute stage to inspect.

Return Value

The current compute device; otherwise, `nil` if one isn’t assigned.

See: https://developer.apple.com/documentation/Vision/VNRequest/computeDeviceForComputeStage:

func (VNRequest) Init

func (r VNRequest) Init() VNRequest

Init initializes the instance.

func (VNRequest) InitWithCompletionHandler

func (r VNRequest) InitWithCompletionHandler(completionHandler ErrorHandler) VNRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func (VNRequest) PreferBackgroundProcessing

func (r VNRequest) PreferBackgroundProcessing() bool

A hint to minimize the resource burden of the request.

Discussion

If set to true, this property reduces the request’s memory footprint, processing footprint, and CPU/GPU contention at the potential cost of longer execution time.

Setting this value can help ensure that Vision processing doesn’t block UI updates and other rendering on the main thread.

See: https://developer.apple.com/documentation/Vision/VNRequest/preferBackgroundProcessing

func (VNRequest) Results

func (r VNRequest) Results() []VNObservation

The collection of observation results generated by request processing.

Discussion

If the request fails, this property is nil. Otherwise, it contains an array of VNObservation subclasses specific to the VNRequest subclass.

Don’t access this property until the request has finished processing.

See: https://developer.apple.com/documentation/Vision/VNRequest/results

func (VNRequest) Revision

func (r VNRequest) Revision() uint

The specific algorithm or implementation revision that’s used to perform the request.

See: https://developer.apple.com/documentation/Vision/VNRequest/revision

func (VNRequest) SetComputeDeviceForComputeStage

func (r VNRequest) SetComputeDeviceForComputeStage(computeDevice coreml.MLComputeDeviceProtocol, computeStage VNComputeStage)

Assigns a compute device for a compute stage.

computeDevice: The compute device to assign to the compute stage.

computeStage: The compute stage.

Discussion

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. Call [SupportedComputeStageDevicesAndReturnError] to get valid compute devices for a request’s compute stages.

See: https://developer.apple.com/documentation/Vision/VNRequest/setComputeDevice:forComputeStage:

func (VNRequest) SetPreferBackgroundProcessing

func (r VNRequest) SetPreferBackgroundProcessing(value bool)

func (VNRequest) SetRevision

func (r VNRequest) SetRevision(value uint)

func (VNRequest) SetSupportedComputeStageDevices

func (r VNRequest) SetSupportedComputeStageDevices(value objectivec.IObject)

func (VNRequest) SetUsesCPUOnly

func (r VNRequest) SetUsesCPUOnly(value bool)

func (VNRequest) SupportedComputeStageDevices

func (r VNRequest) SupportedComputeStageDevices() objectivec.IObject

The collection of compute devices per stage that a request supports.

See: https://developer.apple.com/documentation/vision/vnrequest/supportedcomputestagedevices

func (VNRequest) SupportedComputeStageDevicesAndReturnError

func (r VNRequest) SupportedComputeStageDevicesAndReturnError() (foundation.INSDictionary, error)

The collection of compute devices per stage that a request supports.

Return Value

A dictionary of per-stage compute devices; otherwise, `nil` if an error occurs.

See: https://developer.apple.com/documentation/Vision/VNRequest/supportedComputeStageDevicesAndReturnError:

func (VNRequest) UsesCPUOnly

func (r VNRequest) UsesCPUOnly() bool

A Boolean signifying that the Vision request should execute exclusively on the CPU.

Discussion

This value defaults to false to signify that the Vision request is free to leverage the GPU to accelerate its processing.

See: https://developer.apple.com/documentation/Vision/VNRequest/usesCPUOnly

type VNRequestClass

type VNRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNRequestClass

func GetVNRequestClass() VNRequestClass

GetVNRequestClass returns the class object for VNRequest.

func (VNRequestClass) Alloc

func (vc VNRequestClass) Alloc() VNRequest

Alloc allocates memory for a new instance of the class.

func (VNRequestClass) CurrentRevision

func (_VNRequestClass VNRequestClass) CurrentRevision() uint

The current revison supported by the request.

See: https://developer.apple.com/documentation/Vision/VNRequest/currentRevision

func (VNRequestClass) DefaultRevision

func (_VNRequestClass VNRequestClass) DefaultRevision() uint

The revision of the latest request for the particular SDK linked with the client application.

See: https://developer.apple.com/documentation/Vision/VNRequest/defaultRevision

func (VNRequestClass) SupportedRevisions

func (_VNRequestClass VNRequestClass) SupportedRevisions() foundation.NSIndexSet

The collection of currently-supported algorithm versions for the class of request.

Discussion

This method allows clients to inspect at runtime what capabilities are available for each class of VNRequest in the Vision framework.

See: https://developer.apple.com/documentation/Vision/VNRequest/supportedRevisions

type VNRequestCompletionHandler

type VNRequestCompletionHandler = func(VNRequest, foundation.NSError)

type VNRequestFaceLandmarksConstellation

type VNRequestFaceLandmarksConstellation int

See: https://developer.apple.com/documentation/Vision/VNRequestFaceLandmarksConstellation

const (
	// VNRequestFaceLandmarksConstellation65Points: A constellation with 65 points.
	VNRequestFaceLandmarksConstellation65Points VNRequestFaceLandmarksConstellation = 1
	// VNRequestFaceLandmarksConstellation76Points: A constellation with 76 points.
	VNRequestFaceLandmarksConstellation76Points VNRequestFaceLandmarksConstellation = 2
	// VNRequestFaceLandmarksConstellationNotDefined: An undefined constellation.
	VNRequestFaceLandmarksConstellationNotDefined VNRequestFaceLandmarksConstellation = 0
)

func (VNRequestFaceLandmarksConstellation) String

type VNRequestProgressHandler

type VNRequestProgressHandler = func(VNRequest, float64, foundation.NSError)

type VNRequestProgressProviding

type VNRequestProgressProviding interface {
	objectivec.IObject

	// A block of code executed periodically during a Vision request to report progress on long-running tasks.
	//
	// See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding/progressHandler
	ProgressHandler() VNRequestProgressHandler

	// A Boolean set to true when a request can’t determine its progress in fractions completed.
	//
	// See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding/indeterminate
	Indeterminate() bool

	// A block of code executed periodically during a Vision request to report progress on long-running tasks.
	//
	// See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding/progressHandler
	SetProgressHandler(value VNRequestProgressHandler)
}

A protocol for providing progress information on long-running tasks in Vision.

See: https://developer.apple.com/documentation/Vision/VNRequestProgressProviding

type VNRequestProgressProvidingObject

type VNRequestProgressProvidingObject struct {
	objectivec.Object
}

VNRequestProgressProvidingObject wraps an existing Objective-C object that conforms to the VNRequestProgressProviding protocol.

func VNRequestProgressProvidingObjectFromID

func VNRequestProgressProvidingObjectFromID(id objc.ID) VNRequestProgressProvidingObject

VNRequestProgressProvidingObjectFromID constructs a VNRequestProgressProvidingObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (VNRequestProgressProvidingObject) BaseObject

func (VNRequestProgressProvidingObject) Indeterminate

func (o VNRequestProgressProvidingObject) Indeterminate() bool

func (VNRequestProgressProvidingObject) ProgressHandler

func (VNRequestProgressProvidingObject) SetProgressHandler

func (o VNRequestProgressProvidingObject) SetProgressHandler(value VNRequestProgressHandler)

type VNRequestRevisionProviding

type VNRequestRevisionProviding interface {
	objectivec.IObject

	// The revision of the [VNRequest](<doc://Vision/documentation/Vision/VNRequest>) subclass used to generate the implementing object.
	//
	// See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding/requestRevision
	RequestRevision() uint
}

A protocol for specifying the revision number of Vision algorithms.

See: https://developer.apple.com/documentation/Vision/VNRequestRevisionProviding

type VNRequestRevisionProvidingObject

type VNRequestRevisionProvidingObject struct {
	objectivec.Object
}

VNRequestRevisionProvidingObject wraps an existing Objective-C object that conforms to the VNRequestRevisionProviding protocol.

func VNRequestRevisionProvidingObjectFromID

func VNRequestRevisionProvidingObjectFromID(id objc.ID) VNRequestRevisionProvidingObject

VNRequestRevisionProvidingObjectFromID constructs a VNRequestRevisionProvidingObject from an objc.ID. The object is determined to conform to the protocol at runtime.

func (VNRequestRevisionProvidingObject) BaseObject

func (VNRequestRevisionProvidingObject) RequestRevision

func (o VNRequestRevisionProvidingObject) RequestRevision() uint

type VNRequestTextRecognitionLevel

type VNRequestTextRecognitionLevel int

See: https://developer.apple.com/documentation/Vision/VNRequestTextRecognitionLevel

const (
	// VNRequestTextRecognitionLevelAccurate: Accurate text recognition takes more time to produce a more comprehensive result.
	VNRequestTextRecognitionLevelAccurate VNRequestTextRecognitionLevel = 0
	// VNRequestTextRecognitionLevelFast: Fast text recognition returns results more quickly at the expense of accuracy.
	VNRequestTextRecognitionLevelFast VNRequestTextRecognitionLevel = 1
)

func (VNRequestTextRecognitionLevel) String

type VNRequestTrackingLevel

type VNRequestTrackingLevel int

See: https://developer.apple.com/documentation/Vision/VNRequestTrackingLevel

const (
	// VNRequestTrackingLevelAccurate: Tracking level that favors location accuracy over speed.
	VNRequestTrackingLevelAccurate VNRequestTrackingLevel = 0
	// VNRequestTrackingLevelFast: Tracking level that favors speed over location accuracy.
	VNRequestTrackingLevelFast VNRequestTrackingLevel = 1
)

func (VNRequestTrackingLevel) String

func (e VNRequestTrackingLevel) String() string

type VNSaliencyImageObservation

type VNSaliencyImageObservation struct {
	VNPixelBufferObservation
}

An observation that contains a grayscale heat map of important areas across an image.

Overview

The heat map is a CVPixelBuffer in a one-component floating-point pixel format. Its dimensions are 64 x 64 when fetched in real time, or 68 x 68 when requested in its deferred form.

Locating Salient Regions

See: https://developer.apple.com/documentation/Vision/VNSaliencyImageObservation

func NewVNSaliencyImageObservation

func NewVNSaliencyImageObservation() VNSaliencyImageObservation

NewVNSaliencyImageObservation creates a new VNSaliencyImageObservation instance.

func VNSaliencyImageObservationFromID

func VNSaliencyImageObservationFromID(id objc.ID) VNSaliencyImageObservation

VNSaliencyImageObservationFromID constructs a VNSaliencyImageObservation from an objc.ID.

An observation that contains a grayscale heat map of important areas across an image.

func (VNSaliencyImageObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNSaliencyImageObservation) EncodeWithCoder

func (s VNSaliencyImageObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNSaliencyImageObservation) Init

Init initializes the instance.

func (VNSaliencyImageObservation) SalientObjects

A collection of objects describing the distinct areas of the saliency heat map.

Discussion

The objects in this array don’t follow any specific ordering. It’s up to your app to iterate across the observations and apply desired ordering.

Requesting this array lazily computes the bounds of salient objects within the image.

See: https://developer.apple.com/documentation/Vision/VNSaliencyImageObservation/salientObjects

type VNSaliencyImageObservationClass

type VNSaliencyImageObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNSaliencyImageObservationClass

func GetVNSaliencyImageObservationClass() VNSaliencyImageObservationClass

GetVNSaliencyImageObservationClass returns the class object for VNSaliencyImageObservation.

func (VNSaliencyImageObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNSequenceRequestHandler

type VNSequenceRequestHandler struct {
	objectivec.Object
}

An object that processes image-analysis requests for each frame in a sequence.

Overview

Instantiate this handler to perform Vision requests on a series of images. Unlike the VNImageRequestHandler, you don’t specify the image on creation. Instead, you supply each image frame one by one as you continue to call one of the `perform` methods.

Performing a Sequence Request

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler

func NewVNSequenceRequestHandler

func NewVNSequenceRequestHandler() VNSequenceRequestHandler

NewVNSequenceRequestHandler creates a new VNSequenceRequestHandler instance.

func VNSequenceRequestHandlerFromID

func VNSequenceRequestHandlerFromID(id objc.ID) VNSequenceRequestHandler

VNSequenceRequestHandlerFromID constructs a VNSequenceRequestHandler from an objc.ID.

An object that processes image-analysis requests for each frame in a sequence.

func (VNSequenceRequestHandler) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNSequenceRequestHandler) Init

Init initializes the instance.

func (VNSequenceRequestHandler) PerformRequestsOnCGImageError

func (s VNSequenceRequestHandler) PerformRequestsOnCGImageError(requests []VNRequest, image coregraphics.CGImageRef) (bool, error)

Schedules Vision requests to be performed on a Core Graphics image.

requests: An array of VNRequest requests to perform.

image: The input [CGImage] on which to perform the request. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:)-3zt7l

func (VNSequenceRequestHandler) PerformRequestsOnCGImageOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnCGImageOrientationError(requests []VNRequest, image coregraphics.CGImageRef, orientation objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on a Core Graphics image with known orientation.

requests: An array of VNRequest requests to perform.

image: The input [CGImage] on which to perform the request. // [CGImage]: https://developer.apple.com/documentation/CoreGraphics/CGImage

orientation: The orientation of the input `image`.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:orientation:)-3gcmv

func (VNSequenceRequestHandler) PerformRequestsOnCIImageError

func (s VNSequenceRequestHandler) PerformRequestsOnCIImageError(requests []VNRequest, image objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on Core Image image data.

requests: An array of VNRequest requests to perform.

image: The input [CIImage] on which to perform the request. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

image is a [coreimage.CIImage].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:)-9jtgj

func (VNSequenceRequestHandler) PerformRequestsOnCIImageOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnCIImageOrientationError(requests []VNRequest, image objectivec.IObject, orientation objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on Core Image image data with known orientation.

requests: An array of VNRequest requests to perform.

image: The input [CIImage] on which to perform the request. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the input `image`.

image is a [coreimage.CIImage].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:orientation:)-1bkm1

func (VNSequenceRequestHandler) PerformRequestsOnCMSampleBufferError

func (s VNSequenceRequestHandler) PerformRequestsOnCMSampleBufferError(requests []VNRequest, sampleBuffer objectivec.IObject) (bool, error)

Performs one or more requests on an image contained within a sample buffer.

requests: The array of requests to perform.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

sampleBuffer is a [coremedia.CMSampleBufferRef].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:)-45e73

func (VNSequenceRequestHandler) PerformRequestsOnCMSampleBufferOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnCMSampleBufferOrientationError(requests []VNRequest, sampleBuffer objectivec.IObject, orientation objectivec.IObject) (bool, error)

Performs one or more requests on an image of a specified orientation contained within a sample buffer.

requests: The array of requests to perform.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The orientation of the image contained within the sample buffer.

sampleBuffer is a [coremedia.CMSampleBufferRef].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:orientation:)-6b7rk

func (VNSequenceRequestHandler) PerformRequestsOnCVPixelBufferError

func (s VNSequenceRequestHandler) PerformRequestsOnCVPixelBufferError(requests []VNRequest, pixelBuffer corevideo.CVImageBufferRef) (bool, error)

Schedules one or more Vision requests to be performed on a Core Video pixel buffer.

requests: An array of VNRequest requests to perform.

pixelBuffer: The input [CVPixelBuffer] on which to perform the request. // [CVPixelBuffer]: https://developer.apple.com/documentation/CoreVideo/CVPixelBuffer

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:)-3d7nt

func (VNSequenceRequestHandler) PerformRequestsOnCVPixelBufferOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnCVPixelBufferOrientationError(requests []VNRequest, pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on a Core Video pixel buffer with known orientation.

requests: An array of VNRequest requests to perform.

pixelBuffer: The input [CVPixelBuffer] on which to perform the request. // [CVPixelBuffer]: https://developer.apple.com/documentation/CoreVideo/CVPixelBuffer

orientation: The orientation of the input `image`.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:on:orientation:)-2wvt8

func (VNSequenceRequestHandler) PerformRequestsOnImageDataError

func (s VNSequenceRequestHandler) PerformRequestsOnImageDataError(requests []VNRequest, imageData foundation.INSData) (bool, error)

Schedules one or more Vision requests to be performed on raw image data.

requests: An array of VNRequest requests to perform.

imageData: The input image data on which to perform the request.

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:onImageData:)

func (VNSequenceRequestHandler) PerformRequestsOnImageDataOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnImageDataOrientationError(requests []VNRequest, imageData foundation.INSData, orientation objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on raw data containing an image with known orientation.

requests: An array of VNRequest requests to perform.

imageData: The input image data on which to perform the request.

orientation: The orientation of the input image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:onImageData:orientation:)

func (VNSequenceRequestHandler) PerformRequestsOnImageURLError

func (s VNSequenceRequestHandler) PerformRequestsOnImageURLError(requests []VNRequest, imageURL foundation.INSURL) (bool, error)

Schedules one or more Vision requests to be performed on an image.

requests: An array of VNRequest requests to perform.

imageURL: A URL pointing to the image on which to perform the request.

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:onImageURL:)

func (VNSequenceRequestHandler) PerformRequestsOnImageURLOrientationError

func (s VNSequenceRequestHandler) PerformRequestsOnImageURLOrientationError(requests []VNRequest, imageURL foundation.INSURL, orientation objectivec.IObject) (bool, error)

Schedules one or more Vision requests to be performed on an image with known orientation, at a specific URL.

requests: An array of VNRequest requests to perform.

imageURL: A URL pointing to the image on which to perform the request.

orientation: The orientation of the input image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNSequenceRequestHandler/perform(_:onImageURL:orientation:)

type VNSequenceRequestHandlerClass

type VNSequenceRequestHandlerClass struct {
	// contains filtered or unexported fields
}

func GetVNSequenceRequestHandlerClass

func GetVNSequenceRequestHandlerClass() VNSequenceRequestHandlerClass

GetVNSequenceRequestHandlerClass returns the class object for VNSequenceRequestHandler.

func (VNSequenceRequestHandlerClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNStatefulRequest

type VNStatefulRequest struct {
	VNImageBasedRequest
}

An abstract request type that builds evidence of a condition over time.

Initializing a Request

Configuring the Request

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest

func NewStatefulRequestWithCompletionHandler

func NewStatefulRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNStatefulRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewStatefulRequestWithFrameAnalysisSpacingCompletionHandler

func NewStatefulRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNStatefulRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNStatefulRequest

func NewVNStatefulRequest() VNStatefulRequest

NewVNStatefulRequest creates a new VNStatefulRequest instance.

func VNStatefulRequestFromID

func VNStatefulRequestFromID(id objc.ID) VNStatefulRequest

VNStatefulRequestFromID constructs a VNStatefulRequest from an objc.ID.

An abstract request type that builds evidence of a condition over time.

func (VNStatefulRequest) Autorelease

func (s VNStatefulRequest) Autorelease() VNStatefulRequest

Autorelease adds the receiver to the current autorelease pool.

func (VNStatefulRequest) FrameAnalysisSpacing

func (s VNStatefulRequest) FrameAnalysisSpacing() objectivec.IObject

A time value that indicates the interval between analysis operations.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/frameAnalysisSpacing

func (VNStatefulRequest) Init

Init initializes the instance.

func (VNStatefulRequest) InitWithFrameAnalysisSpacingCompletionHandler

func (s VNStatefulRequest) InitWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler ErrorHandler) VNStatefulRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

frameAnalysisSpacing is a [coremedia.CMTime].

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:)

func (VNStatefulRequest) MinimumLatencyFrameCount

func (s VNStatefulRequest) MinimumLatencyFrameCount() int

The minimum number of frames a request processes before reporting an observation.

Discussion

Video-based requests often need a minimum number of frames before they can report an observation. For example, a movement detection request requires a minimum of five frames before it can generate an observation. This value indicates how responsive a request is at processing incoming data.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/minimumLatencyFrameCount

type VNStatefulRequestClass

type VNStatefulRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNStatefulRequestClass

func GetVNStatefulRequestClass() VNStatefulRequestClass

GetVNStatefulRequestClass returns the class object for VNStatefulRequest.

func (VNStatefulRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTargetedImageRequest

type VNTargetedImageRequest struct {
	VNImageBasedRequest
}

The abstract superclass for image analysis requests that operate on both the processed image and a secondary image.

Overview

Other Vision request handlers that operate on both the processed image and a secondary image inherit from this abstract base class. Instantiate one of its subclasses to perform image analysis, and pass in auxiliary image data by filling in the `options` dictionary at initialization.

Creating a Request

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest

func NewTargetedImageRequestWithCompletionHandler

func NewTargetedImageRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewTargetedImageRequestWithTargetedCGImageOptions

func NewTargetedImageRequestWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func NewTargetedImageRequestWithTargetedCGImageOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func NewTargetedImageRequestWithTargetedCGImageOrientationOptions

func NewTargetedImageRequestWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCGImageOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCIImageOptions

func NewTargetedImageRequestWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options: ciImage is a [coreimage.CIImage].

func NewTargetedImageRequestWithTargetedCIImageOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:) ciImage is a [coreimage.CIImage].

func NewTargetedImageRequestWithTargetedCIImageOrientationOptions

func NewTargetedImageRequestWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options: ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCIImageOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:) ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCMSampleBufferOptions

func NewTargetedImageRequestWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options: sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewTargetedImageRequestWithTargetedCMSampleBufferOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewTargetedImageRequestWithTargetedCMSampleBufferOrientationOptions

func NewTargetedImageRequestWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options: sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCVPixelBufferOptions

func NewTargetedImageRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func NewTargetedImageRequestWithTargetedCVPixelBufferOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func NewTargetedImageRequestWithTargetedCVPixelBufferOrientationOptions

func NewTargetedImageRequestWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedImageDataOptions

func NewTargetedImageRequestWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func NewTargetedImageRequestWithTargetedImageDataOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func NewTargetedImageRequestWithTargetedImageDataOrientationOptions

func NewTargetedImageRequestWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedImageDataOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedImageURLOptions

func NewTargetedImageRequestWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func NewTargetedImageRequestWithTargetedImageURLOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func NewTargetedImageRequestWithTargetedImageURLOrientationOptions

func NewTargetedImageRequestWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTargetedImageRequestWithTargetedImageURLOrientationOptionsCompletionHandler

func NewTargetedImageRequestWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTargetedImageRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNTargetedImageRequest

func NewVNTargetedImageRequest() VNTargetedImageRequest

NewVNTargetedImageRequest creates a new VNTargetedImageRequest instance.

func VNTargetedImageRequestFromID

func VNTargetedImageRequestFromID(id objc.ID) VNTargetedImageRequest

VNTargetedImageRequestFromID constructs a VNTargetedImageRequest from an objc.ID.

The abstract superclass for image analysis requests that operate on both the processed image and a secondary image.

func (VNTargetedImageRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTargetedImageRequest) Init

Init initializes the instance.

func (VNTargetedImageRequest) InitWithTargetedCGImageOptions

func (t VNTargetedImageRequest) InitWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func (VNTargetedImageRequest) InitWithTargetedCGImageOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCGImageOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedCGImageOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCIImageOptions

func (t VNTargetedImageRequest) InitWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

ciImage is a [coreimage.CIImage].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options:

func (VNTargetedImageRequest) InitWithTargetedCIImageOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

ciImage is a [coreimage.CIImage].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCIImageOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

ciImage is a [coreimage.CIImage].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedCIImageOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

ciImage is a [coreimage.CIImage].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCMSampleBufferOptions

func (t VNTargetedImageRequest) InitWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

sampleBuffer is a [coremedia.CMSampleBufferRef].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options:

func (VNTargetedImageRequest) InitWithTargetedCMSampleBufferOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

sampleBuffer is a [coremedia.CMSampleBufferRef].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCMSampleBufferOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

sampleBuffer is a [coremedia.CMSampleBufferRef].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

sampleBuffer is a [coremedia.CMSampleBufferRef].

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCVPixelBufferOptions

func (t VNTargetedImageRequest) InitWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func (VNTargetedImageRequest) InitWithTargetedCVPixelBufferOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedCVPixelBufferOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedImageDataOptions

func (t VNTargetedImageRequest) InitWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func (VNTargetedImageRequest) InitWithTargetedImageDataOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedImageDataOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedImageDataOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedImageURLOptions

func (t VNTargetedImageRequest) InitWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func (VNTargetedImageRequest) InitWithTargetedImageURLOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func (VNTargetedImageRequest) InitWithTargetedImageURLOrientationOptions

func (t VNTargetedImageRequest) InitWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNTargetedImageRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options:

func (VNTargetedImageRequest) InitWithTargetedImageURLOrientationOptionsCompletionHandler

func (t VNTargetedImageRequest) InitWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler ErrorHandler) VNTargetedImageRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

orientation is a [imageio.CGImagePropertyOrientation].

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:)

type VNTargetedImageRequestClass

type VNTargetedImageRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTargetedImageRequestClass

func GetVNTargetedImageRequestClass() VNTargetedImageRequestClass

GetVNTargetedImageRequestClass returns the class object for VNTargetedImageRequest.

func (VNTargetedImageRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTextObservation

type VNTextObservation struct {
	VNRectangleObservation
}

Information about regions of text that an image-analysis request detects.

Overview

This type of observation results from a VNDetectTextRectanglesRequest. It expresses the location of each detected character by its bounding box.

Finding Individual Characters

See: https://developer.apple.com/documentation/Vision/VNTextObservation

func NewTextObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight

func NewTextObservationRectangleObservationWithRequestRevisionTopLeftBottomLeftBottomRightTopRight(requestRevision uint, topLeft corefoundation.CGPoint, bottomLeft corefoundation.CGPoint, bottomRight corefoundation.CGPoint, topRight corefoundation.CGPoint) VNTextObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

bottomLeft: The lower-left corner point.

bottomRight: The lower-right corner point.

topRight: The upper-right corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:bottomLeft:bottomRight:topRight:)

func NewTextObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft

func NewTextObservationRectangleObservationWithRequestRevisionTopLeftTopRightBottomRightBottomLeft(requestRevision uint, topLeft corefoundation.CGPoint, topRight corefoundation.CGPoint, bottomRight corefoundation.CGPoint, bottomLeft corefoundation.CGPoint) VNTextObservation

Creates a rectangle observation from its corner points.

requestRevision: The rectangle detector revision number. A higher revision indicates more recent iterations of the framework.

topLeft: The upper-left corner point.

topRight: The upper-right corner point.

bottomRight: The lower-right corner point.

bottomLeft: The lower-left corner point.

See: https://developer.apple.com/documentation/Vision/VNRectangleObservation/init(requestRevision:topLeft:topRight:bottomRight:bottomLeft:)

func NewTextObservationWithBoundingBox

func NewTextObservationWithBoundingBox(boundingBox corefoundation.CGRect) VNTextObservation

Creates an observation with a bounding box.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(boundingBox:)

func NewTextObservationWithRequestRevisionBoundingBox

func NewTextObservationWithRequestRevisionBoundingBox(requestRevision uint, boundingBox corefoundation.CGRect) VNTextObservation

Creates an observation with a revision number and bounding box.

requestRevision: The revision of the request to use.

boundingBox: The observation’s bounding box, in coordinates normalized to the dimensions of the processed image, with its origin at the image’s lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNDetectedObjectObservation/init(requestRevision:boundingBox:)

func NewVNTextObservation

func NewVNTextObservation() VNTextObservation

NewVNTextObservation creates a new VNTextObservation instance.

func VNTextObservationFromID

func VNTextObservationFromID(id objc.ID) VNTextObservation

VNTextObservationFromID constructs a VNTextObservation from an objc.ID.

Information about regions of text that an image-analysis request detects.

func (VNTextObservation) Autorelease

func (t VNTextObservation) Autorelease() VNTextObservation

Autorelease adds the receiver to the current autorelease pool.

func (VNTextObservation) CharacterBoxes

func (t VNTextObservation) CharacterBoxes() []VNRectangleObservation

An array of detected individual character bounding boxes.

Discussion

If the associated VNDetectTextRectanglesRequest request indicates interest in character boxes by setting the option `reportCharacterBoxes` to true, this property is non-`nil`. If no characters are found, it remains empty.

See: https://developer.apple.com/documentation/Vision/VNTextObservation/characterBoxes

func (VNTextObservation) EncodeWithCoder

func (t VNTextObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNTextObservation) Init

Init initializes the instance.

type VNTextObservationClass

type VNTextObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNTextObservationClass

func GetVNTextObservationClass() VNTextObservationClass

GetVNTextObservationClass returns the class object for VNTextObservation.

func (VNTextObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackHomographicImageRegistrationRequest

type VNTrackHomographicImageRegistrationRequest struct {
	VNStatefulRequest
}

An image-analysis request, as a stateful request you track over time, that determines the perspective warp matrix necessary to align the content of two images.

Overview

This request is similar to VNHomographicImageRegistrationRequest. However, as a VNStatefulRequest, it automatically computes the registration against the previous frame.

See: https://developer.apple.com/documentation/Vision/VNTrackHomographicImageRegistrationRequest

func NewTrackHomographicImageRegistrationRequestWithCompletionHandler

func NewTrackHomographicImageRegistrationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackHomographicImageRegistrationRequest

Creates a new request that tracks the homographic transformation of two images, with a system callback on completion.

completionHandler: The callback the system invokes when it completes the request.

See: https://developer.apple.com/documentation/Vision/VNTrackHomographicImageRegistrationRequest/init(completionHandler:)

func NewTrackHomographicImageRegistrationRequestWithFrameAnalysisSpacingCompletionHandler

func NewTrackHomographicImageRegistrationRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNTrackHomographicImageRegistrationRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNTrackHomographicImageRegistrationRequest

func NewVNTrackHomographicImageRegistrationRequest() VNTrackHomographicImageRegistrationRequest

NewVNTrackHomographicImageRegistrationRequest creates a new VNTrackHomographicImageRegistrationRequest instance.

func VNTrackHomographicImageRegistrationRequestFromID

func VNTrackHomographicImageRegistrationRequestFromID(id objc.ID) VNTrackHomographicImageRegistrationRequest

VNTrackHomographicImageRegistrationRequestFromID constructs a VNTrackHomographicImageRegistrationRequest from an objc.ID.

An image-analysis request, as a stateful request you track over time, that determines the perspective warp matrix necessary to align the content of two images.

func (VNTrackHomographicImageRegistrationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackHomographicImageRegistrationRequest) Init

Init initializes the instance.

type VNTrackHomographicImageRegistrationRequestClass

type VNTrackHomographicImageRegistrationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackHomographicImageRegistrationRequestClass

func GetVNTrackHomographicImageRegistrationRequestClass() VNTrackHomographicImageRegistrationRequestClass

GetVNTrackHomographicImageRegistrationRequestClass returns the class object for VNTrackHomographicImageRegistrationRequest.

func (VNTrackHomographicImageRegistrationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackObjectRequest

type VNTrackObjectRequest struct {
	VNTrackingRequest
}

An image-analysis request that tracks the movement of a previously identified object across multiple images or video frames.

Overview

Use this type of request to track the bounding boxes around objects previously identified in an image. Vision attempts to locate the same object from the input observation throughout the sequence.

Initializing an Object Tracking Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest

func NewTrackObjectRequestWithCompletionHandler

func NewTrackObjectRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackObjectRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewTrackObjectRequestWithDetectedObjectObservation

func NewTrackObjectRequestWithDetectedObjectObservation(observation IVNDetectedObjectObservation) VNTrackObjectRequest

Creates a new object tracking request with a detected object observation.

observation: A detected object observation with bounding box information.

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest/init(detectedObjectObservation:)

func NewTrackObjectRequestWithDetectedObjectObservationCompletionHandler

func NewTrackObjectRequestWithDetectedObjectObservationCompletionHandler(observation IVNDetectedObjectObservation, completionHandler VNRequestCompletionHandler) VNTrackObjectRequest

Creates a new object tracking request with a detected object observation.

observation: A detected object observation with bounding box information.

completionHandler: The callback to invoke after performing the request.

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest/init(detectedObjectObservation:completionHandler:)

func NewVNTrackObjectRequest

func NewVNTrackObjectRequest() VNTrackObjectRequest

NewVNTrackObjectRequest creates a new VNTrackObjectRequest instance.

func VNTrackObjectRequestFromID

func VNTrackObjectRequestFromID(id objc.ID) VNTrackObjectRequest

VNTrackObjectRequestFromID constructs a VNTrackObjectRequest from an objc.ID.

An image-analysis request that tracks the movement of a previously identified object across multiple images or video frames.

func (VNTrackObjectRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackObjectRequest) Init

Init initializes the instance.

func (VNTrackObjectRequest) InitWithDetectedObjectObservation

func (t VNTrackObjectRequest) InitWithDetectedObjectObservation(observation IVNDetectedObjectObservation) VNTrackObjectRequest

Creates a new object tracking request with a detected object observation.

observation: A detected object observation with bounding box information.

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest/init(detectedObjectObservation:)

func (VNTrackObjectRequest) InitWithDetectedObjectObservationCompletionHandler

func (t VNTrackObjectRequest) InitWithDetectedObjectObservationCompletionHandler(observation IVNDetectedObjectObservation, completionHandler ErrorHandler) VNTrackObjectRequest

Creates a new object tracking request with a detected object observation.

observation: A detected object observation with bounding box information.

completionHandler: The callback to invoke after performing the request.

See: https://developer.apple.com/documentation/Vision/VNTrackObjectRequest/init(detectedObjectObservation:completionHandler:)

func (VNTrackObjectRequest) VNTrackObjectRequestRevision1

func (t VNTrackObjectRequest) VNTrackObjectRequestRevision1() int

A constant for specifying revision 1 of the object tracking request.

See: https://developer.apple.com/documentation/vision/vntrackobjectrequestrevision1

func (VNTrackObjectRequest) VNTrackObjectRequestRevision2

func (t VNTrackObjectRequest) VNTrackObjectRequestRevision2() int

A constant for specifying revision 2 of the object tracking request.

See: https://developer.apple.com/documentation/vision/vntrackobjectrequestrevision2

type VNTrackObjectRequestClass

type VNTrackObjectRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackObjectRequestClass

func GetVNTrackObjectRequestClass() VNTrackObjectRequestClass

GetVNTrackObjectRequestClass returns the class object for VNTrackObjectRequest.

func (VNTrackObjectRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackOpticalFlowRequest

type VNTrackOpticalFlowRequest struct {
	VNStatefulRequest
}

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

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.

Configuring the Request

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest

func NewTrackOpticalFlowRequestWithCompletionHandler

func NewTrackOpticalFlowRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackOpticalFlowRequest

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

completionHandler: The callback the system invokes when it completes the request.

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest/init(completionHandler:)

func NewTrackOpticalFlowRequestWithFrameAnalysisSpacingCompletionHandler

func NewTrackOpticalFlowRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNTrackOpticalFlowRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNTrackOpticalFlowRequest

func NewVNTrackOpticalFlowRequest() VNTrackOpticalFlowRequest

NewVNTrackOpticalFlowRequest creates a new VNTrackOpticalFlowRequest instance.

func VNTrackOpticalFlowRequestFromID

func VNTrackOpticalFlowRequestFromID(id objc.ID) VNTrackOpticalFlowRequest

VNTrackOpticalFlowRequestFromID constructs a VNTrackOpticalFlowRequest from an objc.ID.

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

func (VNTrackOpticalFlowRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackOpticalFlowRequest) ComputationAccuracy

The level of accuracy to compute the optical flow.

Discussion

The computational time trends with accuracy level. The default value is [TrackOpticalFlowRequestComputationAccuracyMedium].

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest/computationAccuracy-swift.property

func (VNTrackOpticalFlowRequest) Init

Init initializes the instance.

func (VNTrackOpticalFlowRequest) KeepNetworkOutput

func (t VNTrackOpticalFlowRequest) KeepNetworkOutput() bool

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

Discussion

The default value is false; otherwise, the request ignores [OutputPixelFormat].

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest/keepNetworkOutput

func (VNTrackOpticalFlowRequest) OutputPixelFormat

func (t VNTrackOpticalFlowRequest) OutputPixelFormat() uint32

The pixel format type of the output value.

Discussion

The valid values are kCVPixelFormatType_TwoComponent32Float and kCVPixelFormatType_TwoComponent16Half. The default value is kCVPixelFormatType_TwoComponent32Float.

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest/outputPixelFormat

func (VNTrackOpticalFlowRequest) SetComputationAccuracy

func (VNTrackOpticalFlowRequest) SetKeepNetworkOutput

func (t VNTrackOpticalFlowRequest) SetKeepNetworkOutput(value bool)

func (VNTrackOpticalFlowRequest) SetOutputPixelFormat

func (t VNTrackOpticalFlowRequest) SetOutputPixelFormat(value uint32)

type VNTrackOpticalFlowRequestClass

type VNTrackOpticalFlowRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackOpticalFlowRequestClass

func GetVNTrackOpticalFlowRequestClass() VNTrackOpticalFlowRequestClass

GetVNTrackOpticalFlowRequestClass returns the class object for VNTrackOpticalFlowRequest.

func (VNTrackOpticalFlowRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackOpticalFlowRequestComputationAccuracy

type VNTrackOpticalFlowRequestComputationAccuracy int

See: https://developer.apple.com/documentation/Vision/VNTrackOpticalFlowRequest/ComputationAccuracy-swift.enum

const (
	// VNTrackOpticalFlowRequestComputationAccuracyHigh: An option that indicates a high level of computational accuracy.
	VNTrackOpticalFlowRequestComputationAccuracyHigh VNTrackOpticalFlowRequestComputationAccuracy = 2
	// VNTrackOpticalFlowRequestComputationAccuracyLow: An option that indicates a low level of computational accuracy.
	VNTrackOpticalFlowRequestComputationAccuracyLow VNTrackOpticalFlowRequestComputationAccuracy = 0
	// VNTrackOpticalFlowRequestComputationAccuracyMedium: An option that indicates a moderate level of computational accuracy.
	VNTrackOpticalFlowRequestComputationAccuracyMedium VNTrackOpticalFlowRequestComputationAccuracy = 1
	// VNTrackOpticalFlowRequestComputationAccuracyVeryHigh: An option that indicates a very high level of computational accuracy.
	VNTrackOpticalFlowRequestComputationAccuracyVeryHigh VNTrackOpticalFlowRequestComputationAccuracy = 3
)

func (VNTrackOpticalFlowRequestComputationAccuracy) String

type VNTrackRectangleRequest

type VNTrackRectangleRequest struct {
	VNTrackingRequest
}

An image-analysis request that tracks movement of a previously identified rectangular object across multiple images or video frames.

Overview

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.

Initializing a Rectangle Tracking Request

Identifying Request Revisions

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest

func NewTrackRectangleRequestWithCompletionHandler

func NewTrackRectangleRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackRectangleRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewTrackRectangleRequestWithRectangleObservation

func NewTrackRectangleRequestWithRectangleObservation(observation IVNRectangleObservation) VNTrackRectangleRequest

Creates a new rectangle tracking request with a rectangle observation.

observation: A rectangle observation with bounding box and corner location information.

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest/init(rectangleObservation:)

func NewTrackRectangleRequestWithRectangleObservationCompletionHandler

func NewTrackRectangleRequestWithRectangleObservationCompletionHandler(observation IVNRectangleObservation, completionHandler VNRequestCompletionHandler) VNTrackRectangleRequest

Creates a new rectangle tracking request with a rectangle observation.

observation: A rectangle observation with bounding box and corner location information.

completionHandler: The block to invoke after performing the request.

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest/init(rectangleObservation:completionHandler:)

func NewVNTrackRectangleRequest

func NewVNTrackRectangleRequest() VNTrackRectangleRequest

NewVNTrackRectangleRequest creates a new VNTrackRectangleRequest instance.

func VNTrackRectangleRequestFromID

func VNTrackRectangleRequestFromID(id objc.ID) VNTrackRectangleRequest

VNTrackRectangleRequestFromID constructs a VNTrackRectangleRequest from an objc.ID.

An image-analysis request that tracks movement of a previously identified rectangular object across multiple images or video frames.

func (VNTrackRectangleRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackRectangleRequest) Init

Init initializes the instance.

func (VNTrackRectangleRequest) InitWithRectangleObservation

func (t VNTrackRectangleRequest) InitWithRectangleObservation(observation IVNRectangleObservation) VNTrackRectangleRequest

Creates a new rectangle tracking request with a rectangle observation.

observation: A rectangle observation with bounding box and corner location information.

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest/init(rectangleObservation:)

func (VNTrackRectangleRequest) InitWithRectangleObservationCompletionHandler

func (t VNTrackRectangleRequest) InitWithRectangleObservationCompletionHandler(observation IVNRectangleObservation, completionHandler ErrorHandler) VNTrackRectangleRequest

Creates a new rectangle tracking request with a rectangle observation.

observation: A rectangle observation with bounding box and corner location information.

completionHandler: The block to invoke after performing the request.

See: https://developer.apple.com/documentation/Vision/VNTrackRectangleRequest/init(rectangleObservation:completionHandler:)

func (VNTrackRectangleRequest) VNTrackRectangleRequestRevision1

func (t VNTrackRectangleRequest) VNTrackRectangleRequestRevision1() int

A constant for specifying revision 1 of the rectangling tracking request.

See: https://developer.apple.com/documentation/vision/vntrackrectanglerequestrevision1

type VNTrackRectangleRequestClass

type VNTrackRectangleRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackRectangleRequestClass

func GetVNTrackRectangleRequestClass() VNTrackRectangleRequestClass

GetVNTrackRectangleRequestClass returns the class object for VNTrackRectangleRequest.

func (VNTrackRectangleRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackTranslationalImageRegistrationRequest

type VNTrackTranslationalImageRegistrationRequest struct {
	VNStatefulRequest
}

An image-analysis request, as a stateful request you track over time, that determines the affine transform necessary to align the content of two images.

Overview

This request is similar to VNTranslationalImageRegistrationRequest. However, as a VNStatefulRequest, it automatically computes the registration against the previous frame.

See: https://developer.apple.com/documentation/Vision/VNTrackTranslationalImageRegistrationRequest

func NewTrackTranslationalImageRegistrationRequestWithCompletionHandler

func NewTrackTranslationalImageRegistrationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackTranslationalImageRegistrationRequest

Creates a new request that tracks the translational registration of two images, with a system callback on completion.

completionHandler: The callback the system invokes when it completes the request.

See: https://developer.apple.com/documentation/Vision/VNTrackTranslationalImageRegistrationRequest/init(completionHandler:)

func NewTrackTranslationalImageRegistrationRequestWithFrameAnalysisSpacingCompletionHandler

func NewTrackTranslationalImageRegistrationRequestWithFrameAnalysisSpacingCompletionHandler(frameAnalysisSpacing objectivec.IObject, completionHandler VNRequestCompletionHandler) VNTrackTranslationalImageRegistrationRequest

Initializes a video-based request.

frameAnalysisSpacing: A [CMTime] value that indicates the duration between analysis operations. Increase this value to reduce the number of frames analyzed on slower devices. Set this argument to [zero] to analyze all frames. // [CMTime]: https://developer.apple.com/documentation/CoreMedia/CMTime [zero]: https://developer.apple.com/documentation/CoreMedia/CMTime/zero

completionHandler: A closure that’s invoked after the request has completed its processing. The system invokes the completion handler on the same dispatch queue as the request performs its processing.

See: https://developer.apple.com/documentation/Vision/VNStatefulRequest/init(frameAnalysisSpacing:completionHandler:) frameAnalysisSpacing is a [coremedia.CMTime].

func NewVNTrackTranslationalImageRegistrationRequest

func NewVNTrackTranslationalImageRegistrationRequest() VNTrackTranslationalImageRegistrationRequest

NewVNTrackTranslationalImageRegistrationRequest creates a new VNTrackTranslationalImageRegistrationRequest instance.

func VNTrackTranslationalImageRegistrationRequestFromID

func VNTrackTranslationalImageRegistrationRequestFromID(id objc.ID) VNTrackTranslationalImageRegistrationRequest

VNTrackTranslationalImageRegistrationRequestFromID constructs a VNTrackTranslationalImageRegistrationRequest from an objc.ID.

An image-analysis request, as a stateful request you track over time, that determines the affine transform necessary to align the content of two images.

func (VNTrackTranslationalImageRegistrationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackTranslationalImageRegistrationRequest) Init

Init initializes the instance.

type VNTrackTranslationalImageRegistrationRequestClass

type VNTrackTranslationalImageRegistrationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackTranslationalImageRegistrationRequestClass

func GetVNTrackTranslationalImageRegistrationRequestClass() VNTrackTranslationalImageRegistrationRequestClass

GetVNTrackTranslationalImageRegistrationRequestClass returns the class object for VNTrackTranslationalImageRegistrationRequest.

func (VNTrackTranslationalImageRegistrationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrackingRequest

type VNTrackingRequest struct {
	VNImageBasedRequest
}

The abstract superclass for image-analysis requests that track unique features across multiple images or video frames.

Overview

Instantiate a tracking request subclass to perform object tracking across multiple frames of an image. After initialization, configure the degree of accuracy by setting VNTrackingRequest.TrackingLevel, and provide observations you’d like to track by setting the VNTrackingRequest.InputObservation initial bounding box.

Configuring a Tracking Request

Getting the Number of Trackers

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest

func NewTrackingRequestWithCompletionHandler

func NewTrackingRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTrackingRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewVNTrackingRequest

func NewVNTrackingRequest() VNTrackingRequest

NewVNTrackingRequest creates a new VNTrackingRequest instance.

func VNTrackingRequestFromID

func VNTrackingRequestFromID(id objc.ID) VNTrackingRequest

VNTrackingRequestFromID constructs a VNTrackingRequest from an objc.ID.

The abstract superclass for image-analysis requests that track unique features across multiple images or video frames.

func (VNTrackingRequest) Autorelease

func (t VNTrackingRequest) Autorelease() VNTrackingRequest

Autorelease adds the receiver to the current autorelease pool.

func (VNTrackingRequest) Init

Init initializes the instance.

func (VNTrackingRequest) InputObservation

func (t VNTrackingRequest) InputObservation() IVNDetectedObjectObservation

The observation object defining a region to track.

Discussion

Providing an observation not returned from a tracker, such as a user-defined observation, begins a new tracker for the sequence. Providing an observation that was returned from a tracker continues the use of that tracker, to track the region to the next frame.

In general, unless specified in the request’s documentation or header file, you must define the rectangle in normalized coordinates, with the origin at the lower-left corner.

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest/inputObservation

func (VNTrackingRequest) LastFrame

func (t VNTrackingRequest) LastFrame() bool

A Boolean that indicates the last frame in a tracking sequence.

Discussion

If set to true, the current tracker will be released to the pool of available trackers when the current frame finishes processing.

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest/isLastFrame

func (VNTrackingRequest) SetInputObservation

func (t VNTrackingRequest) SetInputObservation(value IVNDetectedObjectObservation)

func (VNTrackingRequest) SetLastFrame

func (t VNTrackingRequest) SetLastFrame(value bool)

func (VNTrackingRequest) SetTrackingLevel

func (t VNTrackingRequest) SetTrackingLevel(value VNRequestTrackingLevel)

func (VNTrackingRequest) SupportedNumberOfTrackersAndReturnError

func (t VNTrackingRequest) SupportedNumberOfTrackersAndReturnError() (uint, error)

Returns the maximum number of simultaneous trackers for the request.

error: An error that contains the reason why a failure occurs.

Return Value

The maximum number of trackers given a combination; or `0` if such combination doesn’t exist.

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest/supportedNumber(ofTrackersAndReturnError:)

func (VNTrackingRequest) TrackingLevel

func (t VNTrackingRequest) TrackingLevel() VNRequestTrackingLevel

A value for specifying whether to prioritize speed or location accuracy.

See: https://developer.apple.com/documentation/Vision/VNTrackingRequest/trackingLevel

type VNTrackingRequestClass

type VNTrackingRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTrackingRequestClass

func GetVNTrackingRequestClass() VNTrackingRequestClass

GetVNTrackingRequestClass returns the class object for VNTrackingRequest.

func (VNTrackingRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTrajectoryObservation

type VNTrajectoryObservation struct {
	VNObservation
}

An observation that describes a detected trajectory.

Evaluating an Observation

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation

func NewVNTrajectoryObservation

func NewVNTrajectoryObservation() VNTrajectoryObservation

NewVNTrajectoryObservation creates a new VNTrajectoryObservation instance.

func VNTrajectoryObservationFromID

func VNTrajectoryObservationFromID(id objc.ID) VNTrajectoryObservation

VNTrajectoryObservationFromID constructs a VNTrajectoryObservation from an objc.ID.

An observation that describes a detected trajectory.

func (VNTrajectoryObservation) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTrajectoryObservation) DetectedPoints

func (t VNTrajectoryObservation) DetectedPoints() []VNPoint

The centroid points of the detected contour along the trajectory.

Discussion

The detected points may differ slightly from the ideal trajectory because they fall within the allowed tolerance. The system limits the maximum number of points based on the maximum trajectory length set in the request.

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation/detectedPoints

func (VNTrajectoryObservation) EncodeWithCoder

func (t VNTrajectoryObservation) EncodeWithCoder(coder foundation.INSCoder)

func (VNTrajectoryObservation) EquationCoefficients

func (t VNTrajectoryObservation) EquationCoefficients() objectivec.IObject

The coefficients of the parabolic equation.

Discussion

This equation describes the parabola on which the detected contour is traveling. The equation and the projected points get refined over time.

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation/equationCoefficients

func (VNTrajectoryObservation) Init

Init initializes the instance.

func (VNTrajectoryObservation) MovingAverageRadius

func (t VNTrajectoryObservation) MovingAverageRadius() float64

The moving average radius of the object the request is tracking.

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation/movingAverageRadius

func (VNTrajectoryObservation) ProjectedPoints

func (t VNTrajectoryObservation) ProjectedPoints() []VNPoint

The centroids of the calculated trajectory from the detected points.

Discussion

The projected points define the ideal trajectory described by the parabolic equation. The equation’s coefficients and the projected points of the detected trajectory get refined over time. The system limits the maximum number of cached points to the maximum points needed to describe the trajectory together with the parabolic equation.

See: https://developer.apple.com/documentation/Vision/VNTrajectoryObservation/projectedPoints

func (VNTrajectoryObservation) Results

The array of detected trajectory observations.

See: https://developer.apple.com/documentation/vision/vndetecttrajectoriesrequest/results

func (VNTrajectoryObservation) SetResults

type VNTrajectoryObservationClass

type VNTrajectoryObservationClass struct {
	// contains filtered or unexported fields
}

func GetVNTrajectoryObservationClass

func GetVNTrajectoryObservationClass() VNTrajectoryObservationClass

GetVNTrajectoryObservationClass returns the class object for VNTrajectoryObservation.

func (VNTrajectoryObservationClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNTranslationalImageRegistrationRequest

type VNTranslationalImageRegistrationRequest struct {
	VNImageRegistrationRequest
}

An image-analysis request that determines the affine transform necessary to align the content of two images.

Overview

Create and perform a translational image registration request to align content in two images through translation.

See: https://developer.apple.com/documentation/Vision/VNTranslationalImageRegistrationRequest

func NewTranslationalImageRegistrationRequestWithCompletionHandler

func NewTranslationalImageRegistrationRequestWithCompletionHandler(completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new Vision request with an optional completion handler.

completionHandler: The block to invoke after the request finishes processing.

Discussion

Vision executes the completion handler on the same queue that it executes the request; however, this queue differs from the one where you called [PerformRequestsError].

See: https://developer.apple.com/documentation/Vision/VNRequest/init(completionHandler:)

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOptions

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOptions(cgImage coregraphics.CGImageRef, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Graphics image.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:options:

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOptionsCompletionHandler(cgImage coregraphics.CGImageRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Graphics image, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:options:completionHandler:)

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOrientationOptions(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCGImage:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCGImageOrientationOptionsCompletionHandler(cgImage coregraphics.CGImageRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Graphics image of known orientation, executing the completion handler when done.

cgImage: The targeted Core Graphics image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCGImage:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOptions

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOptions(ciImage objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:options: ciImage is a [coreimage.CIImage].

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOptionsCompletionHandler(ciImage objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Image image.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:options:completionHandler:) ciImage is a [coreimage.CIImage].

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOrientationOptions(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCIImage:orientation:options: ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCIImageOrientationOptionsCompletionHandler(ciImage objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting a Core Image image of known orientation, executing the completion handler when done.

ciImage: The [CIImage] encapsulating the targeted image. // [CIImage]: https://developer.apple.com/documentation/CoreImage/CIImage

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCIImage:orientation:options:completionHandler:) ciImage is a [coreimage.CIImage]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOptions

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOptions(sampleBuffer objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:options: sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOptionsCompletionHandler(sampleBuffer objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request with a completion handler that targets an image in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef].

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptions(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientation values. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCMSampleBuffer:orientation:options: sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(sampleBuffer objectivec.IObject, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request with a completion handler that targets an image of a known orientation in a sample buffer.

sampleBuffer: A sample buffer containing a valid [imageBuffer]. // [imageBuffer]: https://developer.apple.com/documentation/CoreMedia/CMSampleBuffer/imageBuffer

orientation: The EXIF orientation of the image. See [CGImagePropertyOrientation] for supported orientations. // [CGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/CGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The callback the system invokes when the request finishes executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCMSampleBuffer:orientation:options:completionHandler:) sampleBuffer is a [coremedia.CMSampleBufferRef]. orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOptions

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOptions(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:options:

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer.

pixelBuffer: The pixel buffer containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:options:completionHandler:)

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptions(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedCVPixelBuffer:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(pixelBuffer corevideo.CVImageBufferRef, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image in a pixel buffer of known orientation.

pixelBuffer: The pixel buffer containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedCVPixelBuffer:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOptions

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOptions(imageData foundation.INSData, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image as raw data.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:options:

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOptionsCompletionHandler(imageData foundation.INSData, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image as raw data, executing the completion handler when done.

imageData: The data containing the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:options:completionHandler:)

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOrientationOptions(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageData:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedImageDataOrientationOptionsCompletionHandler(imageData foundation.INSData, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting a raw data image of known orientation, executing the completion handler when done.

imageData: The data containing the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageData:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOptions

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOptions(imageURL foundation.INSURL, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image at the specified URL.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:options:

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOptionsCompletionHandler(imageURL foundation.INSURL, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:options:completionHandler:)

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOrientationOptions

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOrientationOptions(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/initWithTargetedImageURL:orientation:options: orientation is a [imageio.CGImagePropertyOrientation].

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler

func NewTranslationalImageRegistrationRequestWithTargetedImageURLOrientationOptionsCompletionHandler(imageURL foundation.INSURL, orientation objectivec.IObject, options foundation.INSDictionary, completionHandler VNRequestCompletionHandler) VNTranslationalImageRegistrationRequest

Creates a new request targeting an image of known orientation, at the specified URL, executing the completion handler when done.

imageURL: The URL of the targeted image.

orientation: The orientation of the image buffer, based on EXIF specification and superseding other orientation information. The value must be an integer from `1` to `8`; see [kCGImagePropertyOrientation] for details. // [kCGImagePropertyOrientation]: https://developer.apple.com/documentation/ImageIO/kCGImagePropertyOrientation

options: A dictionary with options specifying auxiliary information for the image.

completionHandler: The block to invoke when the request has finished executing.

See: https://developer.apple.com/documentation/Vision/VNTargetedImageRequest/init(targetedImageURL:orientation:options:completionHandler:) orientation is a [imageio.CGImagePropertyOrientation].

func NewVNTranslationalImageRegistrationRequest

func NewVNTranslationalImageRegistrationRequest() VNTranslationalImageRegistrationRequest

NewVNTranslationalImageRegistrationRequest creates a new VNTranslationalImageRegistrationRequest instance.

func VNTranslationalImageRegistrationRequestFromID

func VNTranslationalImageRegistrationRequestFromID(id objc.ID) VNTranslationalImageRegistrationRequest

VNTranslationalImageRegistrationRequestFromID constructs a VNTranslationalImageRegistrationRequest from an objc.ID.

An image-analysis request that determines the affine transform necessary to align the content of two images.

func (VNTranslationalImageRegistrationRequest) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNTranslationalImageRegistrationRequest) Init

Init initializes the instance.

type VNTranslationalImageRegistrationRequestClass

type VNTranslationalImageRegistrationRequestClass struct {
	// contains filtered or unexported fields
}

func GetVNTranslationalImageRegistrationRequestClass

func GetVNTranslationalImageRegistrationRequestClass() VNTranslationalImageRegistrationRequestClass

GetVNTranslationalImageRegistrationRequestClass returns the class object for VNTranslationalImageRegistrationRequest.

func (VNTranslationalImageRegistrationRequestClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNVector

type VNVector struct {
	objectivec.Object
}

An immutable 2D vector represented by its x-axis and y-axis projections.

Creating a Vector

Inspecting a Vector

  • VNVector.Length: The length, or absolute value, of the vector.
  • VNVector.R: The radius, absolute value, or length of the vector.
  • VNVector.Theta: The angle between the vector direction and the positive direction of the x-axis.
  • VNVector.SquaredLength: The squared length of the vector.
  • VNVector.X: A signed projection that indicates the vector’s direction on the x-axis.
  • VNVector.Y: A signed projection that indicates the vector’s direction on the y-axis.

See: https://developer.apple.com/documentation/Vision/VNVector

func NewVNVector

func NewVNVector() VNVector

NewVNVector creates a new VNVector instance.

func NewVectorByAddingVectorToVector

func NewVectorByAddingVectorToVector(v1 IVNVector, v2 IVNVector) VNVector

Creates a new vector by adding the specified vectors.

v1: The first vector.

v2: The second vector.

See: https://developer.apple.com/documentation/Vision/VNVector/init(byAdding:to:)

func NewVectorByMultiplyingVectorByScalar

func NewVectorByMultiplyingVectorByScalar(vector IVNVector, scalar float64) VNVector

Creates a new vector by multiplying the specified vector’s x-axis and y-axis projections by the scalar value.

vector: The vector.

scalar: The scalar value by which to multiply the x-axis and y-axis projections.

See: https://developer.apple.com/documentation/Vision/VNVector/init(byMultiplying:byScalar:)

func NewVectorBySubtractingVectorFromVector

func NewVectorBySubtractingVectorFromVector(v1 IVNVector, v2 IVNVector) VNVector

Creates a new vector by subtracting the first vector from the second vector.

v1: The first vector.

v2: The second vector.

See: https://developer.apple.com/documentation/Vision/VNVector/init(bySubtracting:from:)

func NewVectorWithRTheta

func NewVectorWithRTheta(r float64, theta float64) VNVector

Creates a new vector in polar coordinate space.

r: The length of the vector.

theta: The angle that the vector forms with the positive direction of the x-axis.

See: https://developer.apple.com/documentation/Vision/VNVector/init(r:theta:)

func NewVectorWithVectorHeadTail

func NewVectorWithVectorHeadTail(head IVNPoint, tail IVNPoint) VNVector

Creates a new vector in Cartesian coordinate space.

head: The vector’s head point.

tail: The vector’s tail point.

See: https://developer.apple.com/documentation/Vision/VNVector/init(vectorHead:tail:)

func NewVectorWithXComponentYComponent

func NewVectorWithXComponentYComponent(x float64, y float64) VNVector

Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections.

x: The x-component.

y: The y-component.

See: https://developer.apple.com/documentation/Vision/VNVector/init(xComponent:yComponent:)

func VNVectorFromID

func VNVectorFromID(id objc.ID) VNVector

VNVectorFromID constructs a VNVector from an objc.ID.

An immutable 2D vector represented by its x-axis and y-axis projections.

func (VNVector) Autorelease

func (v VNVector) Autorelease() VNVector

Autorelease adds the receiver to the current autorelease pool.

func (VNVector) EncodeWithCoder

func (v VNVector) EncodeWithCoder(coder foundation.INSCoder)

func (VNVector) Init

func (v VNVector) Init() VNVector

Init initializes the instance.

func (VNVector) InitWithRTheta

func (v VNVector) InitWithRTheta(r float64, theta float64) VNVector

Creates a new vector in polar coordinate space.

r: The length of the vector.

theta: The angle that the vector forms with the positive direction of the x-axis.

See: https://developer.apple.com/documentation/Vision/VNVector/init(r:theta:)

func (VNVector) InitWithVectorHeadTail

func (v VNVector) InitWithVectorHeadTail(head IVNPoint, tail IVNPoint) VNVector

Creates a new vector in Cartesian coordinate space.

head: The vector’s head point.

tail: The vector’s tail point.

See: https://developer.apple.com/documentation/Vision/VNVector/init(vectorHead:tail:)

func (VNVector) InitWithXComponentYComponent

func (v VNVector) InitWithXComponentYComponent(x float64, y float64) VNVector

Creates a new vector in Cartesian coordinate space, based on its x-axis and y-axis projections.

x: The x-component.

y: The y-component.

See: https://developer.apple.com/documentation/Vision/VNVector/init(xComponent:yComponent:)

func (VNVector) Length

func (v VNVector) Length() float64

The length, or absolute value, of the vector.

See: https://developer.apple.com/documentation/Vision/VNVector/length

func (VNVector) R

func (v VNVector) R() float64

The radius, absolute value, or length of the vector.

See: https://developer.apple.com/documentation/Vision/VNVector/r

func (VNVector) SquaredLength

func (v VNVector) SquaredLength() float64

The squared length of the vector.

See: https://developer.apple.com/documentation/Vision/VNVector/squaredLength

func (VNVector) Theta

func (v VNVector) Theta() float64

The angle between the vector direction and the positive direction of the x-axis.

See: https://developer.apple.com/documentation/Vision/VNVector/theta

func (VNVector) X

func (v VNVector) X() float64

A signed projection that indicates the vector’s direction on the x-axis.

See: https://developer.apple.com/documentation/Vision/VNVector/x

func (VNVector) Y

func (v VNVector) Y() float64

A signed projection that indicates the vector’s direction on the y-axis.

See: https://developer.apple.com/documentation/Vision/VNVector/y

type VNVectorClass

type VNVectorClass struct {
	// contains filtered or unexported fields
}

func GetVNVectorClass

func GetVNVectorClass() VNVectorClass

GetVNVectorClass returns the class object for VNVector.

func (VNVectorClass) Alloc

func (vc VNVectorClass) Alloc() VNVector

Alloc allocates memory for a new instance of the class.

func (VNVectorClass) DotProductOfVectorVector

func (_VNVectorClass VNVectorClass) DotProductOfVectorVector(v1 IVNVector, v2 IVNVector) float64

Caclulates the dot product of two vectors.

v1: The first vector.

v2: The second vector.

Return Value

The dot product value.

See: https://developer.apple.com/documentation/Vision/VNVector/dotProduct(of:vector:)

func (VNVectorClass) UnitVectorForVector

func (_VNVectorClass VNVectorClass) UnitVectorForVector(vector IVNVector) VNVector

Calculates a vector that’s normalized by preserving its direction, so that the vector length equals 1.0.

vector: The vector whose unit vector you want to calculate.

Return Value

The unit vector.

See: https://developer.apple.com/documentation/Vision/VNVector/unitVector(for:)

func (VNVectorClass) ZeroVector

func (_VNVectorClass VNVectorClass) ZeroVector() VNVector

A vector object with zero length.

See: https://developer.apple.com/documentation/Vision/VNVector/zero

type VNVideoProcessor

type VNVideoProcessor struct {
	objectivec.Object
}

An object that performs offline analysis of video content.

Creating a Video Processor

Performing Requests

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor

func NewVNVideoProcessor

func NewVNVideoProcessor() VNVideoProcessor

NewVNVideoProcessor creates a new VNVideoProcessor instance.

func NewVideoProcessorWithURL

func NewVideoProcessorWithURL(videoURL foundation.INSURL) VNVideoProcessor

Creates a video processor to perform Vision requests against the specified video asset.

videoURL: The video asset URL. The specified asset must be a video format supported by AVFoundation.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/init(url:)

func VNVideoProcessorFromID

func VNVideoProcessorFromID(id objc.ID) VNVideoProcessor

VNVideoProcessorFromID constructs a VNVideoProcessor from an objc.ID.

An object that performs offline analysis of video content.

func (VNVideoProcessor) AddRequestProcessingOptionsError

func (v VNVideoProcessor) AddRequestProcessingOptionsError(request IVNRequest, processingOptions IVNVideoProcessorRequestProcessingOptions) (bool, error)

Adds a request with processing options to the video processor.

request: The Vision request to add.

processingOptions: The processing options to apply.

Discussion

Call this method either before calling [AnalyzeTimeRangeError] or from within the completion handler of an already associated request.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/addRequest(_:processingOptions:)

func (VNVideoProcessor) AnalyzeTimeRangeError

func (v VNVideoProcessor) AnalyzeTimeRangeError(timeRange objectivec.IObject) (bool, error)

Analyzes a time range of video content.

timeRange: The time range to analyze. The value must be within the time range of the video asset.

timeRange is a [coremedia.CMTimeRange].

Discussion

The system executes this method synchronously, so you typically call it from a separate dispatch queue. It returns when the video processor finishes analyzing the time range or if an error prevents processing.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/analyze(_:)

func (VNVideoProcessor) Autorelease

func (v VNVideoProcessor) Autorelease() VNVideoProcessor

Autorelease adds the receiver to the current autorelease pool.

func (VNVideoProcessor) Cancel

func (v VNVideoProcessor) Cancel()

Cancels the video processing.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/cancel()

func (VNVideoProcessor) Init

Init initializes the instance.

func (VNVideoProcessor) InitWithURL

func (v VNVideoProcessor) InitWithURL(videoURL foundation.INSURL) VNVideoProcessor

Creates a video processor to perform Vision requests against the specified video asset.

videoURL: The video asset URL. The specified asset must be a video format supported by AVFoundation.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/init(url:)

func (VNVideoProcessor) RemoveRequestError

func (v VNVideoProcessor) RemoveRequestError(request IVNRequest) (bool, error)

Removes a Vision request from the video processor’s request queue.

request: The request to remove.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/removeRequest(_:)

type VNVideoProcessorCadence

type VNVideoProcessorCadence struct {
	objectivec.Object
}

An object that defines the cadence at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/Cadence

func NewVNVideoProcessorCadence

func NewVNVideoProcessorCadence() VNVideoProcessorCadence

NewVNVideoProcessorCadence creates a new VNVideoProcessorCadence instance.

func VNVideoProcessorCadenceFromID

func VNVideoProcessorCadenceFromID(id objc.ID) VNVideoProcessorCadence

VNVideoProcessorCadenceFromID constructs a VNVideoProcessorCadence from an objc.ID.

An object that defines the cadence at which to process video.

func (VNVideoProcessorCadence) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNVideoProcessorCadence) Cadence

The cadence the video processor maintains to process the request.

See: https://developer.apple.com/documentation/vision/vnvideoprocessor/requestprocessingoptions/cadence

func (VNVideoProcessorCadence) Init

Init initializes the instance.

func (VNVideoProcessorCadence) SetCadence

type VNVideoProcessorCadenceClass

type VNVideoProcessorCadenceClass struct {
	// contains filtered or unexported fields
}

func GetVNVideoProcessorCadenceClass

func GetVNVideoProcessorCadenceClass() VNVideoProcessorCadenceClass

GetVNVideoProcessorCadenceClass returns the class object for VNVideoProcessorCadence.

func (VNVideoProcessorCadenceClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNVideoProcessorClass

type VNVideoProcessorClass struct {
	// contains filtered or unexported fields
}

func GetVNVideoProcessorClass

func GetVNVideoProcessorClass() VNVideoProcessorClass

GetVNVideoProcessorClass returns the class object for VNVideoProcessor.

func (VNVideoProcessorClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNVideoProcessorFrameRateCadence

type VNVideoProcessorFrameRateCadence struct {
	VNVideoProcessorCadence
}

An object that defines a frame-based cadence for processing a video stream.

Creating a Cadence

Inspecting the Frame Rate

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/FrameRateCadence

func NewVNVideoProcessorFrameRateCadence

func NewVNVideoProcessorFrameRateCadence() VNVideoProcessorFrameRateCadence

NewVNVideoProcessorFrameRateCadence creates a new VNVideoProcessorFrameRateCadence instance.

func NewVideoProcessorFrameRateCadenceWithFrameRate

func NewVideoProcessorFrameRateCadenceWithFrameRate(frameRate int) VNVideoProcessorFrameRateCadence

Creates a new frame-based cadence with a frame rate.

frameRate: The frame rate at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/FrameRateCadence/init(_:)

func VNVideoProcessorFrameRateCadenceFromID

func VNVideoProcessorFrameRateCadenceFromID(id objc.ID) VNVideoProcessorFrameRateCadence

VNVideoProcessorFrameRateCadenceFromID constructs a VNVideoProcessorFrameRateCadence from an objc.ID.

An object that defines a frame-based cadence for processing a video stream.

func (VNVideoProcessorFrameRateCadence) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNVideoProcessorFrameRateCadence) FrameRate

func (v VNVideoProcessorFrameRateCadence) FrameRate() int

The frame rate at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/FrameRateCadence/frameRate

func (VNVideoProcessorFrameRateCadence) Init

Init initializes the instance.

func (VNVideoProcessorFrameRateCadence) InitWithFrameRate

Creates a new frame-based cadence with a frame rate.

frameRate: The frame rate at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/FrameRateCadence/init(_:)

type VNVideoProcessorFrameRateCadenceClass

type VNVideoProcessorFrameRateCadenceClass struct {
	// contains filtered or unexported fields
}

func GetVNVideoProcessorFrameRateCadenceClass

func GetVNVideoProcessorFrameRateCadenceClass() VNVideoProcessorFrameRateCadenceClass

GetVNVideoProcessorFrameRateCadenceClass returns the class object for VNVideoProcessorFrameRateCadence.

func (VNVideoProcessorFrameRateCadenceClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNVideoProcessorRequestProcessingOptions

type VNVideoProcessorRequestProcessingOptions struct {
	objectivec.Object
}

An object that defines a video processor’s configuration options.

Configuring Options

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/RequestProcessingOptions

func NewVNVideoProcessorRequestProcessingOptions

func NewVNVideoProcessorRequestProcessingOptions() VNVideoProcessorRequestProcessingOptions

NewVNVideoProcessorRequestProcessingOptions creates a new VNVideoProcessorRequestProcessingOptions instance.

func VNVideoProcessorRequestProcessingOptionsFromID

func VNVideoProcessorRequestProcessingOptionsFromID(id objc.ID) VNVideoProcessorRequestProcessingOptions

VNVideoProcessorRequestProcessingOptionsFromID constructs a VNVideoProcessorRequestProcessingOptions from an objc.ID.

An object that defines a video processor’s configuration options.

func (VNVideoProcessorRequestProcessingOptions) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNVideoProcessorRequestProcessingOptions) Cadence

The cadence the video processor maintains to process the request.

Discussion

By default, the system processes every frame of video if you don’t provide a value for this property.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/RequestProcessingOptions/cadence

func (VNVideoProcessorRequestProcessingOptions) Init

Init initializes the instance.

func (VNVideoProcessorRequestProcessingOptions) SetCadence

type VNVideoProcessorRequestProcessingOptionsClass

type VNVideoProcessorRequestProcessingOptionsClass struct {
	// contains filtered or unexported fields
}

func GetVNVideoProcessorRequestProcessingOptionsClass

func GetVNVideoProcessorRequestProcessingOptionsClass() VNVideoProcessorRequestProcessingOptionsClass

GetVNVideoProcessorRequestProcessingOptionsClass returns the class object for VNVideoProcessorRequestProcessingOptions.

func (VNVideoProcessorRequestProcessingOptionsClass) Alloc

Alloc allocates memory for a new instance of the class.

type VNVideoProcessorTimeIntervalCadence

type VNVideoProcessorTimeIntervalCadence struct {
	VNVideoProcessorCadence
}

An object that defines a time-based cadence for processing a video stream.

Creating a Cadence

Inspecting the Time Interval

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/TimeIntervalCadence

func NewVNVideoProcessorTimeIntervalCadence

func NewVNVideoProcessorTimeIntervalCadence() VNVideoProcessorTimeIntervalCadence

NewVNVideoProcessorTimeIntervalCadence creates a new VNVideoProcessorTimeIntervalCadence instance.

func NewVideoProcessorTimeIntervalCadenceWithTimeInterval

func NewVideoProcessorTimeIntervalCadenceWithTimeInterval(timeInterval float64) VNVideoProcessorTimeIntervalCadence

Creates a new time-based cadence with a time interval.

timeInterval: The time interval at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/TimeIntervalCadence/init(_:)

func VNVideoProcessorTimeIntervalCadenceFromID

func VNVideoProcessorTimeIntervalCadenceFromID(id objc.ID) VNVideoProcessorTimeIntervalCadence

VNVideoProcessorTimeIntervalCadenceFromID constructs a VNVideoProcessorTimeIntervalCadence from an objc.ID.

An object that defines a time-based cadence for processing a video stream.

func (VNVideoProcessorTimeIntervalCadence) Autorelease

Autorelease adds the receiver to the current autorelease pool.

func (VNVideoProcessorTimeIntervalCadence) Init

Init initializes the instance.

func (VNVideoProcessorTimeIntervalCadence) InitWithTimeInterval

Creates a new time-based cadence with a time interval.

timeInterval: The time interval at which to process video.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/TimeIntervalCadence/init(_:)

func (VNVideoProcessorTimeIntervalCadence) TimeInterval

The time interval of the cadence.

See: https://developer.apple.com/documentation/Vision/VNVideoProcessor/TimeIntervalCadence/timeInterval

type VNVideoProcessorTimeIntervalCadenceClass

type VNVideoProcessorTimeIntervalCadenceClass struct {
	// contains filtered or unexported fields
}

func GetVNVideoProcessorTimeIntervalCadenceClass

func GetVNVideoProcessorTimeIntervalCadenceClass() VNVideoProcessorTimeIntervalCadenceClass

GetVNVideoProcessorTimeIntervalCadenceClass returns the class object for VNVideoProcessorTimeIntervalCadence.

func (VNVideoProcessorTimeIntervalCadenceClass) Alloc

Alloc allocates memory for a new instance of the class.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL