Class VisionSource

  • All Implemented Interfaces:
    AutoCloseable

    public final class VisionSource
    extends Object
    implements AutoCloseable
    VisionSource class represents a source for vision-related operations.

    Note: close() must be called in order to release underlying resources held by the object.

    • Method Detail

      • fromImageSourceBuffer

        public static VisionSource fromImageSourceBuffer​(ImageSourceBuffer source)
        Create VisionSource from an ImageSourceBuffer, allowing the application to pass in an image from a memory buffer.
        Parameters:
        source - The image source buffer containing the image to process.
        Returns:
        A new VisionSource instance that uses the specified input source buffer.
      • fromFrameSource

        public static VisionSource fromFrameSource​(FrameSource source)
        Creates a new frame-oriented VisionSource
        Parameters:
        source - The FrameSource to be bound to the VisionSource.
        Returns:
        A new VisionSource instance.
      • fromFile

        public static VisionSource fromFile​(String filePath,
                                            FrameFormat frameFormat)
        Create VisionSource from image file Using this factory method, the image is transferred directly from the file to SDK and configured as format given in parameter.
        Parameters:
        filePath - The file path to the image
        frameFormat - The format of the image frame
        Returns:
        A new VisionSource instance.
      • fromByteBuffer

        public static VisionSource fromByteBuffer​(ByteBuffer buffer)
        Create VisionSource from a byte buffer Using this factory method, the byte buffer is read without decoding.
        Parameters:
        buffer - The byte buffer
        Returns:
        A new VisionSource instance.
      • getId

        public final String getId()
        Gets the identification string of the vision source.
        Returns:
        Identification string
      • getProperties

        public final PropertyCollection getProperties()
        Gets the property collection associated to vision source object
        Returns:
        PropertyCollection object
      • getHandle

        public final SafeHandle getHandle()
        Gets the internal native handle.
        Returns:
        Native handle as SafeHandle
      • close

        public final void close()
        Explicitly frees any external resource attached to the object
        Specified by:
        close in interface AutoCloseable
      • fromFile

        public static VisionSource fromFile​(String filePath)
        Create VisionSource from image file
        Parameters:
        filePath - The file path to the image
        Returns:
        A new VisionSource instance.
      • fromDefaultCamera

        public static VisionSource fromDefaultCamera​(VisionSourceOptions ops)
        Create VisionSource from Android VisionSourceOptions
        Parameters:
        ops - The vision source options
        Returns:
        A new VisionSource instance
      • getCameraPreviewFormat

        public final FrameFormat getCameraPreviewFormat()
        Get camera internal preview format
        Returns:
        A FrameFormat instance