Package io.scanbot.sdk.documentscanner
Class DocumentDetectionResult
java.lang.Object
io.scanbot.sdk.documentscanner.DocumentDetectionResult
Result of the document contour detection.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentDetectionResult(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.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. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGetter for aspectRatio field.intGetter for averageBrightness field.Getter for detectionScores field.Getter for displacement field.Getter for displacementVector field.Getter for horizontalLines field.Getter for horizontalLinesNormalized field.Getter for points field.Getter for pointsNormalized field.Getter for status field.Getter for verticalLines field.Getter for verticalLinesNormalized field.
-
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
Getter for status field. See constructor documentation for more information about the field.- Returns:
- status
-
getDetectionScores
Getter for detectionScores field. See constructor documentation for more information about the field.- Returns:
- detectionScores
-
getPoints
Getter for points field. See constructor documentation for more information about the field.- Returns:
- points
-
getHorizontalLines
Getter for horizontalLines field. See constructor documentation for more information about the field.- Returns:
- horizontalLines
-
getVerticalLines
Getter for verticalLines field. See constructor documentation for more information about the field.- Returns:
- verticalLines
-
getPointsNormalized
Getter for pointsNormalized field. See constructor documentation for more information about the field.- Returns:
- pointsNormalized
-
getHorizontalLinesNormalized
Getter for horizontalLinesNormalized field. See constructor documentation for more information about the field.- Returns:
- horizontalLinesNormalized
-
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
Getter for displacement field. See constructor documentation for more information about the field.- Returns:
- displacement
-
getDisplacementVector
Getter for displacementVector field. See constructor documentation for more information about the field.- Returns:
- displacementVector
-