Package apple.vision

Class VNContour

  • All Implemented Interfaces:
    NSCopying, NSObject, VNRequestRevisionProviding

    public class VNContour
    extends NSObject
    implements NSCopying, VNRequestRevisionProviding
    The VNContour class describes a contour provided by a VNContoursObservation. VNContour objects are lightweight objects that act as a façade which allows access to a small slice of the usually much larger block of data owned by a VNContoursObservation that represents all of the contours detected in an image. While the interface does present the notion of a hierarchy of parent/child contours, the implementation purposefully does not contain any explicit internal bookkeeping for this relationship. Instead, contours are uniquely identified via their indexPath property. As a side effect of this choice, repeated calls to methods that would return relational contours (e.g., -childContours or -childContourAtIndex:error:) are NOT guaranteed to return the same VNContour instances over and over again. If this kind of parent/child object stability is an absolute requirement of the client, then they are responsible for creating the necessary data structures to represent and build that instance-stable hierarchy.
    • Constructor Detail

      • VNContour

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • aspectRatio

        public float aspectRatio()
        The aspect ratio of the contour from the original image aspect ration expressed as width/height
      • automaticallyNotifiesObserversForKey

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

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

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

        public VNContour childContourAtIndexError​(long childContourIndex,
                                                  org.moe.natj.general.ptr.Ptr<NSError> error)
        Returns a VNContour object that is a child of this VNContour at the specified index.
        Parameters:
        childContourIndex - The index into the childContours array.
        error - The error returned if the child contour cannot be provided.
        Returns:
        The VNContour object at the spefiied index path, or nil of a failure occurs.
      • childContourCount

        public long childContourCount()
        The total number of child contours in the target contour. The use of this property is prefered over childContours.count due to the cost of building the child objects.
      • childContours

        public NSArray<? extends VNContour> childContours()
        The array of the contours enclosed by the target contour. This property may come with the cost of instantiating new VNContour objects; therefore, clients are strongly encouraged to hold the results in a local variable instead of repeatedly invoking it.
      • classFallbacksForKeyedArchiver

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

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

        public java.lang.Object copyWithZone​(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()
      • hash_static

        public static long hash_static()
      • indexPath

        public NSIndexPath indexPath()
        The path to the target VNContour as it is stored in the owning VNContoursObservation's hierarchy of contours.
      • 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)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • normalizedPath

        public CGPathRef normalizedPath()
        The contour represented as a CGPath in normalized coordinates. The path is owned by this object and therefore will be alive as long as the the observation is alive.
      • pointCount

        public long pointCount()
        The number of points that describe the contour.
      • polygonApproximationWithEpsilonError

        public VNContour polygonApproximationWithEpsilonError​(float epsilon,
                                                              org.moe.natj.general.ptr.Ptr<NSError> error)
        Simplifies the contour's collection of points into a polygon using the Ramer Douglas Peucker Algorithm. See
        Parameters:
        epsilon - Points that have a perpendicular distance to the line segment they are on that greather than epsilon are kept, others are eliminated.
        error - The error returned if a simplified contour cannot be created.
        Returns:
        A new VNContour object with a simplified polygon consisting of a subset of the points that defined the original VNContour.
      • 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()
      • version_static

        public static long version_static()