Class CNDetection

  • All Implemented Interfaces:
    NSCopying, NSObject

    public class CNDetection
    extends NSObject
    implements NSCopying
    A cinematic detection of a subject. Specifies the type, distance (as disparity), bounds (as a normalized rectangle), and time (as CMTime) of the detection. Detections obtained from the cinematic script include a detectionID that can be used to track the detection over time. Some types of detections also include a detectionGroupID that associates related detections (e.g. the face and torso of the same person). API-Since: 17.0
    • Constructor Detail

      • CNDetection

        protected CNDetection​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • accessibilityLabelForDetectionType

        @NotNull
        public static @NotNull java.lang.String accessibilityLabelForDetectionType​(long detectionType)
        A localized accessibility label converting a specific detection type into a broad category (person, pet, etc.).
      • allocWithZone

        public static CNDetection allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • copyWithZone

        @NotNull
        public @NotNull java.lang.Object copyWithZone​(@Nullable
                                                      @Nullable org.moe.natj.general.ptr.VoidPtr zone)
        Specified by:
        copyWithZone in interface NSCopying
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • detectionGroupID

        public long detectionGroupID()
        An unique identifier assigned by the cinematic script to all detections of the same subject and related detection types across time. For example, the face/torso detections of the same person are assigned the same detectionGroupID.
      • detectionID

        public long detectionID()
        An unique identifier assigned by the cinematic script to all detections of the same subject and detection type across time. If you build a custom detection track, the detectionID will be assigned when you add it to the script.
      • detectionType

        public long detectionType()
        The type of object that was detected (face, torso, cat, dog, etc.)
      • disparityInNormalizedRectSourceDisparityDetectionTypePriorDisparity

        public static float disparityInNormalizedRectSourceDisparityDetectionTypePriorDisparity​(CGRect normalizedRect,
                                                                                                @NotNull
                                                                                                @NotNull CVBufferRef sourceDisparity,
                                                                                                long detectionType,
                                                                                                float priorDisparity)
        Determine the disparity to use to focus on the object in the rectangle. - Parameters: - disparityBuffer: A pixel buffer from the cinematic disparity track for the frame in which the object occurs. - normalizedRect: The rectangle within the disparity buffer where the object occurs, normalized such that (0.0, 0.0) is the top-left and (1.0, 1.0) is the bottom-right of the disparity buffer. - detectionType: The type of object expected within the rectangle. Pass `CNDetectionTypeUnknown` if unknown. - priorDisparity: The disparity of the object in the prior frame. This helps ensure the object is not mistaken for another that enters the same rectangle. Pass `NAN` if there is no known prior, such as in the first frame in which the object is being tracked.
      • focusDisparity

        public float focusDisparity()
        The disparity to use in order to focus on the object. If the disparity is unknown, use the class method to find it: `disparityInNormalizedRect:sourceDisparity:detectionType:priorDisparity:`.
      • hash_static

        public static long hash_static()
      • initWithTimeDetectionTypeNormalizedRectFocusDisparity

        public CNDetection initWithTimeDetectionTypeNormalizedRectFocusDisparity​(CMTime time,
                                                                                 long detectionType,
                                                                                 CGRect normalizedRect,
                                                                                 float focusDisparity)
        Initialize a cinematic detection. For playback and edit, most detections are obtained by from the cinematic script rather than being created. However, if you need to add a custom track, you can build an array of detections to create one. Any detections you create will not have a valid detectionID until the custom track is added to the cinematic script. Doing so will return the assigned detectionID. Any detections newly obtained from the cinematic script will have their assigned detectionID. - Parameters: - time: the presentation time of the frame in which the detection occurred - detectionType: the type of object that was detected (face, torso, cat, dog, etc.) - normalizedRect: the rectangle within the image where the object occurs, normalized such that (0.0, 0.0) is the top-left and (1.0, 1.0) is the bottom-right - focusDisparity: the disparity to use in order to focus on the object (use the static `disparity` method to compute if unknown)
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • isValidDetectionGroupID

        public static boolean isValidDetectionGroupID​(long detectionGroupID)
        Determine whether a given detectionGroupID is valid
      • isValidDetectionID

        public static boolean isValidDetectionID​(long detectionID)
        Determine whether a given detectionID is valid
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • normalizedRect

        public CGRect normalizedRect()
        The rectangle within the image where the object occurs, normalized such that (0.0, 0.0) is the top-left and (1.0, 1.0) is the bottom-right.
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • time

        public CMTime time()
        The presentation time of the frame in which the detection occurred.
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • version_static

        public static long version_static()