Class DocumentDetectionResult

java.lang.Object
io.scanbot.sdk.documentscanner.DocumentDetectionResult

public class DocumentDetectionResult extends Object
Result of the document contour detection.
  • Constructor Details

    • DocumentDetectionResult

      public DocumentDetectionResult(DocumentDetectionStatus status, DocumentDetectionScores detectionScores, List<Point> points, List<LineSegmentInt> horizontalLines, List<LineSegmentInt> verticalLines, List<PointF> pointsNormalized, List<LineSegmentFloat> horizontalLinesNormalized, List<LineSegmentFloat> verticalLinesNormalized, double aspectRatio, int averageBrightness, DocumentDisplacement displacement, PointF displacementVector)
      Constructs DocumentDetectionResult with the given params.
      Parameters:
      status - Detection status. Default is `NOT_ACQUIRED`.
      detectionScores - The total and partial scores for the detected quad.
      points - Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
      horizontalLines - All detected horizontal lines in image space.
      verticalLines - All detected vertical lines in image space.
      pointsNormalized - Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
      horizontalLinesNormalized - Normalized horizontal lines in image space.
      verticalLinesNormalized - Normalized vertical lines in image space.
      aspectRatio - Aspect ratio of the detected document contour.
      averageBrightness - Average brightness, calculated as the average of the Value channel in the HSV color space of: - the whole image, if no document was detected - the document crop, if a document was detected Ranges from 0 to 255. Default is `0`.
      displacement - ML engine mode only: The direction towards the center of the document if the document is partially visible. Requires allowPartiallyVisibleDocuments to be true. Default is `NONE`.
      displacementVector - ML engine mode only: The direction vector towards the center of the document if the document is partially visible in normalized coordinates. Requires allowPartiallyVisibleDocuments to be true.
    • DocumentDetectionResult

      public DocumentDetectionResult(DocumentDetectionScores detectionScores, List<Point> points, List<LineSegmentInt> horizontalLines, List<LineSegmentInt> verticalLines, List<PointF> pointsNormalized, List<LineSegmentFloat> horizontalLinesNormalized, List<LineSegmentFloat> verticalLinesNormalized, double aspectRatio, PointF displacementVector)
      Constructs DocumentDetectionResult with default parameters.
      Parameters:
      detectionScores - The total and partial scores for the detected quad.
      points - Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
      horizontalLines - All detected horizontal lines in image space.
      verticalLines - All detected vertical lines in image space.
      pointsNormalized - Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
      horizontalLinesNormalized - Normalized horizontal lines in image space.
      verticalLinesNormalized - Normalized vertical lines in image space.
      aspectRatio - Aspect ratio of the detected document contour.
      displacementVector - ML engine mode only: The direction vector towards the center of the document if the document is partially visible in normalized coordinates. Requires allowPartiallyVisibleDocuments to be true.
  • Method Details

    • getStatus

      public DocumentDetectionStatus getStatus()
      Getter for status field. See constructor documentation for more information about the field.
      Returns:
      status
    • getDetectionScores

      public DocumentDetectionScores getDetectionScores()
      Getter for detectionScores field. See constructor documentation for more information about the field.
      Returns:
      detectionScores
    • getPoints

      public List<Point> getPoints()
      Getter for points field. See constructor documentation for more information about the field.
      Returns:
      points
    • getHorizontalLines

      public List<LineSegmentInt> getHorizontalLines()
      Getter for horizontalLines field. See constructor documentation for more information about the field.
      Returns:
      horizontalLines
    • getVerticalLines

      public List<LineSegmentInt> getVerticalLines()
      Getter for verticalLines field. See constructor documentation for more information about the field.
      Returns:
      verticalLines
    • getPointsNormalized

      public List<PointF> getPointsNormalized()
      Getter for pointsNormalized field. See constructor documentation for more information about the field.
      Returns:
      pointsNormalized
    • getHorizontalLinesNormalized

      public List<LineSegmentFloat> getHorizontalLinesNormalized()
      Getter for horizontalLinesNormalized field. See constructor documentation for more information about the field.
      Returns:
      horizontalLinesNormalized
    • getVerticalLinesNormalized

      public List<LineSegmentFloat> getVerticalLinesNormalized()
      Getter for verticalLinesNormalized field. See constructor documentation for more information about the field.
      Returns:
      verticalLinesNormalized
    • getAspectRatio

      public double getAspectRatio()
      Getter for aspectRatio field. See constructor documentation for more information about the field.
      Returns:
      aspectRatio
    • getAverageBrightness

      public int getAverageBrightness()
      Getter for averageBrightness field. See constructor documentation for more information about the field.
      Returns:
      averageBrightness
    • getDisplacement

      public DocumentDisplacement getDisplacement()
      Getter for displacement field. See constructor documentation for more information about the field.
      Returns:
      displacement
    • getDisplacementVector

      public PointF getDisplacementVector()
      Getter for displacementVector field. See constructor documentation for more information about the field.
      Returns:
      displacementVector