public class VNGenerateOpticalFlowRequest extends VNTargetedImageRequest
Because this request works at the pixel level, both images must have the same dimensions in order for the request to be successfully performed. Setting a region of interest will isolate where the change determination is performed; however, the resultant observation will still be reported with a full resolution VNPixelBufferObservation.
Optical flow requests are very resource intensive, so it is recommended that only one request at a time be created and that the handler where the request was issued be released immediately after generating optical flows.
Example usage:
- (nullable VNPixelBufferObservation*) opticalFlowFromImage:(CVPixelBufferRef)fromImage toImage:(CVPixelBuffer)toImage error:(NSError**)error { VNImageRequestHandler* imageRequestHandler = [[VNImageRequestHandler alloc] initWithCVPixelBuffer:fromImage options:@{}]; VNGenerateOpticalFlowRequest* request = [[VNGenerateOpticalFlowRequest alloc] initWithTargetedCVPixelBuffer:toImage options:@{}]; if (![imageRequestHandler performRequests:@[ request ] error:error]) { return nil; }
return [[request results] firstObject]; }
VNTargetedImageRequest.Block_initWithTargetedCGImageOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCGImageOrientationOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCIImageOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCIImageOrientationOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCMSampleBufferOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCMSampleBufferOrientationOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCVPixelBufferOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedCVPixelBufferOrientationOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedImageDataOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedImageDataOrientationOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedImageURLOptionsCompletionHandler, VNTargetedImageRequest.Block_initWithTargetedImageURLOrientationOptionsCompletionHandlerVNRequest.Block_completionHandler_ret, VNRequest.Block_initWithCompletionHandlerNSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
VNGenerateOpticalFlowRequest(org.moe.natj.general.Pointer peer) |
regionOfInterest, setRegionOfInterestcancel, completionHandler, copyWithZone, preferBackgroundProcessing, revision, setPreferBackgroundProcessing, setRevision, setUsesCPUOnly, usesCPUOnlyaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected VNGenerateOpticalFlowRequest(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static VNGenerateOpticalFlowRequest alloc()
public static VNGenerateOpticalFlowRequest allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public long computationAccuracy()
The computational time typically trends with the accuracy level. This parameter allows for selective tuning by the client application.
public static long currentRevision()
public static java.lang.String debugDescription_static()
public static long defaultRevision()
public static java.lang.String description_static()
public static long hash_static()
public VNGenerateOpticalFlowRequest init()
VNRequestinit in class VNTargetedImageRequestpublic VNGenerateOpticalFlowRequest initWithCompletionHandler(VNRequest.Block_initWithCompletionHandler completionHandler)
VNRequestinitWithCompletionHandler in class VNTargetedImageRequestcompletionHandler - The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.public VNGenerateOpticalFlowRequest initWithTargetedCGImageOptions(CGImageRef cgImage, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCGImageOptions in class VNTargetedImageRequestcgImage - The CGImageRef of the targeted image.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCGImageOptionsCompletionHandler(CGImageRef cgImage, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCGImageOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCGImageOptionsCompletionHandler in class VNTargetedImageRequestcgImage - The CGImageRef of the targeted image.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCGImageOrientationOptions(CGImageRef cgImage, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCGImageOrientationOptions in class VNTargetedImageRequestcgImage - The CGImageRef of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCGImageOrientationOptionsCompletionHandler(CGImageRef cgImage, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCGImageOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCGImageOrientationOptionsCompletionHandler in class VNTargetedImageRequestcgImage - The CGImageRef of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCIImageOptions(CIImage ciImage, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCIImageOptions in class VNTargetedImageRequestciImage - The CIImage of the targeted image.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCIImageOptionsCompletionHandler(CIImage ciImage, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCIImageOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCIImageOptionsCompletionHandler in class VNTargetedImageRequestciImage - The CIImage of the targeted image.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCIImageOrientationOptions(CIImage ciImage, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCIImageOrientationOptions in class VNTargetedImageRequestciImage - The CIImage of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCIImageOrientationOptionsCompletionHandler(CIImage ciImage, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCIImageOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCIImageOrientationOptionsCompletionHandler in class VNTargetedImageRequestciImage - The CIImage of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCMSampleBufferOptions(CMSampleBufferRef sampleBuffer, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCMSampleBufferOptions in class VNTargetedImageRequestsampleBuffer - The CMSampleBuffer containing the CVImageBuffer to be used by the request.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCMSampleBufferOptionsCompletionHandler(CMSampleBufferRef sampleBuffer, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCMSampleBufferOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCMSampleBufferOptionsCompletionHandler in class VNTargetedImageRequestsampleBuffer - The CMSampleBuffer containing the CVImageBuffer to be used by the request.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked after the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCMSampleBufferOrientationOptions(CMSampleBufferRef sampleBuffer, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCMSampleBufferOrientationOptions in class VNTargetedImageRequestsampleBuffer - The CMSampleBuffer containing the CVImageBuffer to be used by the request.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCMSampleBufferOrientationOptionsCompletionHandler(CMSampleBufferRef sampleBuffer, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCMSampleBufferOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCMSampleBufferOrientationOptionsCompletionHandler in class VNTargetedImageRequestsampleBuffer - The CMSampleBuffer containing the CVImageBuffer to be used by the request.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked after the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCVPixelBufferOptions(CVBufferRef pixelBuffer, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCVPixelBufferOptions in class VNTargetedImageRequestpixelBuffer - The pixel buffer containing the targeted image.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCVPixelBufferOptionsCompletionHandler(CVBufferRef pixelBuffer, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCVPixelBufferOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCVPixelBufferOptionsCompletionHandler in class VNTargetedImageRequestpixelBuffer - The pixel buffer containing the targeted image.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedCVPixelBufferOrientationOptions(CVBufferRef pixelBuffer, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedCVPixelBufferOrientationOptions in class VNTargetedImageRequestpixelBuffer - The pixel buffer containing the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedCVPixelBufferOrientationOptionsCompletionHandler(CVBufferRef pixelBuffer, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedCVPixelBufferOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedCVPixelBufferOrientationOptionsCompletionHandler in class VNTargetedImageRequestpixelBuffer - The pixel buffer containing the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedImageDataOptions(NSData imageData, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedImageDataOptions in class VNTargetedImageRequestimageData - The data of the targeted image.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedImageDataOptionsCompletionHandler(NSData imageData, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedImageDataOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedImageDataOptionsCompletionHandler in class VNTargetedImageRequestimageData - The data of the targeted image.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedImageDataOrientationOptions(NSData imageData, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedImageDataOrientationOptions in class VNTargetedImageRequestimageData - The data of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedImageDataOrientationOptionsCompletionHandler(NSData imageData, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedImageDataOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedImageDataOrientationOptionsCompletionHandler in class VNTargetedImageRequestimageData - The data of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedImageURLOptions(NSURL imageURL, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedImageURLOptions in class VNTargetedImageRequestimageURL - The URL of the targeted image.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedImageURLOptionsCompletionHandler(NSURL imageURL, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedImageURLOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedImageURLOptionsCompletionHandler in class VNTargetedImageRequestimageURL - The URL of the targeted image.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public VNGenerateOpticalFlowRequest initWithTargetedImageURLOrientationOptions(NSURL imageURL, int orientation, NSDictionary<java.lang.String,?> options)
VNTargetedImageRequestinitWithTargetedImageURLOrientationOptions in class VNTargetedImageRequestimageURL - The URL of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.public VNGenerateOpticalFlowRequest initWithTargetedImageURLOrientationOptionsCompletionHandler(NSURL imageURL, int orientation, NSDictionary<java.lang.String,?> options, VNTargetedImageRequest.Block_initWithTargetedImageURLOrientationOptionsCompletionHandler completionHandler)
VNTargetedImageRequestinitWithTargetedImageURLOrientationOptionsCompletionHandler in class VNTargetedImageRequestimageURL - The URL of the targeted image.orientation - The orientation of the image/buffer based on the EXIF specification. For details see kCGImagePropertyOrientation. The value has to be an integer from 1 to 8. This supersedes every other orientation information.options - A dictionary with options specifying auxiliary information for the image.completionHandler - The block that is invoked when the request has been performed.public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static VNGenerateOpticalFlowRequest new_objc()
public int outputPixelFormat()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setComputationAccuracy(long value)
The computational time typically trends with the accuracy level. This parameter allows for selective tuning by the client application.
public void setOutputPixelFormat(int value)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static NSIndexSet supportedRevisions()
public static long version_static()
public NSArray<? extends VNPixelBufferObservation> results()