Class GenericDocument

java.lang.Object
io.scanbot.sdk.genericdocument.GenericDocument
All Implemented Interfaces:
AutoCloseable

public class GenericDocument extends Object implements AutoCloseable
Generic document.
  • Constructor Details

    • GenericDocument

      public GenericDocument(GenericDocumentType type, List<Field> fields, List<GenericDocument> children, List<PointF> quad, List<PointF> quadInRoot, ImageRef crop, double confidence, double confidenceWeight)
      Constructs GenericDocument with the given params.
      Parameters:
      type - Document type.
      fields - List of document fields.
      children - List of document sub-documents.
      quad - Coordinates of the document in the parent document coordinate system.
      quadInRoot - Coordinates of the document in the root document coordinate system.
      crop - Image crop of the document.
      confidence - The average confidence in the accuracy of the document recognition result. Default is `0`.
      confidenceWeight - The weight of the confidence. Can be used to calculate the weighted average confidence of two documents. Default is `0`.
    • GenericDocument

      public GenericDocument(GenericDocumentType type, List<Field> fields, List<GenericDocument> children, List<PointF> quad, List<PointF> quadInRoot)
      Constructs GenericDocument with default parameters.
      Parameters:
      type - Document type.
      fields - List of document fields.
      children - List of document sub-documents.
      quad - Coordinates of the document in the parent document coordinate system.
      quadInRoot - Coordinates of the document in the root document coordinate system.
  • Method Details

    • getType

      public GenericDocumentType getType()
      Getter for type field. See constructor documentation for more information about the field.
      Returns:
      type
    • getFields

      public List<Field> getFields()
      Getter for fields field. See constructor documentation for more information about the field.
      Returns:
      fields
    • getChildren

      public List<GenericDocument> getChildren()
      Getter for children field. See constructor documentation for more information about the field.
      Returns:
      children
    • getQuad

      public List<PointF> getQuad()
      Getter for quad field. See constructor documentation for more information about the field.
      Returns:
      quad
    • getQuadInRoot

      public List<PointF> getQuadInRoot()
      Getter for quadInRoot field. See constructor documentation for more information about the field.
      Returns:
      quadInRoot
    • getCrop

      public ImageRef getCrop()
      Getter for crop field. See constructor documentation for more information about the field.
      Returns:
      crop
    • getConfidence

      public double getConfidence()
      Getter for confidence field. See constructor documentation for more information about the field.
      Returns:
      confidence
    • getConfidenceWeight

      public double getConfidenceWeight()
      Getter for confidenceWeight field. See constructor documentation for more information about the field.
      Returns:
      confidenceWeight
    • close

      public void close()
      Closes native resources (images) held by the object.
      Specified by:
      close in interface AutoCloseable