Class DocumentDetectionResult
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class DocumentDetectionResult implements Parcelable
Result of the document contour detection.
-
-
Field Summary
Fields Modifier and Type Field Description private final DocumentDetectionStatus
status
private final DocumentDetectionScores
detectionScores
private final List<Point>
points
private final List<LineSegmentInt>
horizontalLines
private final List<LineSegmentInt>
verticalLines
private final List<PointF>
pointsNormalized
private final List<LineSegmentFloat>
horizontalLinesNormalized
private final List<LineSegmentFloat>
verticalLinesNormalized
private final Double
aspectRatio
private final Integer
averageBrightness
-
Constructor Summary
Constructors Constructor Description DocumentDetectionResult(Map<String, Object> source)
DocumentDetectionResult(JSONObject json)
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, Integer averageBrightness)
-
Method Summary
Modifier and Type Method Description final DocumentDetectionStatus
getStatus()
Detection status. final DocumentDetectionScores
getDetectionScores()
The total and partial scores for the detected quad. final List<Point>
getPoints()
Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner. final List<LineSegmentInt>
getHorizontalLines()
All detected horizontal lines in image space. final List<LineSegmentInt>
getVerticalLines()
All detected vertical lines in image space. final List<PointF>
getPointsNormalized()
Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner. final List<LineSegmentFloat>
getHorizontalLinesNormalized()
Normalized horizontal lines in image space. final List<LineSegmentFloat>
getVerticalLinesNormalized()
Normalized vertical lines in image space. final Double
getAspectRatio()
Aspect ratio of the detected document contour. final Integer
getAverageBrightness()
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.
final JSONObject
toJson(ToJsonConfiguration config)
final DocumentDetectionResult
clone()
-
-
Constructor Detail
-
DocumentDetectionResult
DocumentDetectionResult(JSONObject json)
-
DocumentDetectionResult
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, Integer averageBrightness)
-
-
Method Detail
-
getStatus
final DocumentDetectionStatus getStatus()
Detection status.
Default is NOT_ACQUIRED
-
getDetectionScores
final DocumentDetectionScores getDetectionScores()
The total and partial scores for the detected quad.
-
getPoints
final List<Point> getPoints()
Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
-
getHorizontalLines
final List<LineSegmentInt> getHorizontalLines()
All detected horizontal lines in image space.
-
getVerticalLines
final List<LineSegmentInt> getVerticalLines()
All detected vertical lines in image space.
-
getPointsNormalized
final List<PointF> getPointsNormalized()
Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.
-
getHorizontalLinesNormalized
final List<LineSegmentFloat> getHorizontalLinesNormalized()
Normalized horizontal lines in image space.
-
getVerticalLinesNormalized
final List<LineSegmentFloat> getVerticalLinesNormalized()
Normalized vertical lines in image space.
-
getAspectRatio
final Double getAspectRatio()
Aspect ratio of the detected document contour.
-
getAverageBrightness
final Integer getAverageBrightness()
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
-
toJson
final JSONObject toJson(ToJsonConfiguration config)
-
clone
final DocumentDetectionResult clone()
-
-
-