Result of the document contour detection.

Hierarchy (view full)

Constructors

Properties

aspectRatio: number

Aspect ratio of the detected document contour.

averageBrightness: number

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

detectionScores: DocumentDetectionScores

The total and partial scores for the detected quad.

horizontalLines: LineSegmentInt[]

All detected horizontal lines in image space.

horizontalLinesNormalized: LineSegmentFloat[]

Normalized horizontal lines in image space.

points: Point[]

Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.

pointsNormalized: Point[]

Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.

Detection status.

Default is NOT_ACQUIRED

verticalLines: LineSegmentInt[]

All detected vertical lines in image space.

verticalLinesNormalized: LineSegmentFloat[]

Normalized vertical lines in image space.

Methods

  • Parameters

    Returns {
        aspectRatio?: number;
        averageBrightness?: number;
        detectionScores?: {
            angleScore?: number;
            aspectRatioScore?: number;
            distanceScore?: number;
            heightScore?: number;
            lineCoverageScore?: number;
            sizeScore?: number;
            totalScore?: number;
            widthScore?: number;
            serialize?: any;
        };
        horizontalLines?: (undefined | {
            end?: {
                x?: number;
                y?: number;
            };
            start?: {
                x?: number;
                y?: number;
            };
            serialize?: any;
        })[];
        horizontalLinesNormalized?: (undefined | {
            end?: {
                x?: number;
                y?: number;
            };
            start?: {
                x?: number;
                y?: number;
            };
            serialize?: any;
        })[];
        points?: (undefined | {
            x?: number;
            y?: number;
        })[];
        pointsNormalized?: (undefined | {
            x?: number;
            y?: number;
        })[];
        status?: DocumentDetectionStatus;
        verticalLines?: (undefined | {
            end?: {
                x?: number;
                y?: number;
            };
            start?: {
                x?: number;
                y?: number;
            };
            serialize?: any;
        })[];
        verticalLinesNormalized?: (undefined | {
            end?: {
                x?: number;
                y?: number;
            };
            start?: {
                x?: number;
                y?: number;
            };
            serialize?: any;
        })[];
        serialize?: any;
    }

    • Optional Readonly aspectRatio?: number

      Aspect ratio of the detected document contour.

    • Optional Readonly averageBrightness?: number

      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

    • Optional Readonly detectionScores?: {
          angleScore?: number;
          aspectRatioScore?: number;
          distanceScore?: number;
          heightScore?: number;
          lineCoverageScore?: number;
          sizeScore?: number;
          totalScore?: number;
          widthScore?: number;
          serialize?: any;
      }

      The total and partial scores for the detected quad.

      • Optional Readonly angleScore?: number

        100 points, if all angles are 90 degrees.

      • Optional Readonly aspectRatioScore?: number

        100 points, if the aspect ratio matches exactly one of the given aspect ratios.

      • Optional Readonly distanceScore?: number

        100 points, if the center of the contour is exactly in the image center.

      • Optional Readonly heightScore?: number

        Percentage of the image height taken by the detected document.

      • Optional Readonly lineCoverageScore?: number

        Percentage of the document contour that the edge detector was able to find (in LEGACY engine mode only).

      • Optional Readonly sizeScore?: number

        100 points, if the contour occupies at least 50% of the area of the image.

      • Optional Readonly totalScore?: number

        Weighted sum of all partial scores.

      • Optional Readonly widthScore?: number

        Percentage of the image width taken by the detected document.

    • Optional Readonly horizontalLines?: (undefined | {
          end?: {
              x?: number;
              y?: number;
          };
          start?: {
              x?: number;
              y?: number;
          };
          serialize?: any;
      })[]

      All detected horizontal lines in image space.

    • Optional Readonly horizontalLinesNormalized?: (undefined | {
          end?: {
              x?: number;
              y?: number;
          };
          start?: {
              x?: number;
              y?: number;
          };
          serialize?: any;
      })[]

      Normalized horizontal lines in image space.

    • Optional Readonly points?: (undefined | {
          x?: number;
          y?: number;
      })[]

      Absolute coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.

    • Optional Readonly pointsNormalized?: (undefined | {
          x?: number;
          y?: number;
      })[]

      Normalized coordinates of the detected document contour in image space sorted in clockwise order, starting from the top left corner.

    • Optional Readonly status?: DocumentDetectionStatus

      Detection status.

      Default is NOT_ACQUIRED

    • Optional Readonly verticalLines?: (undefined | {
          end?: {
              x?: number;
              y?: number;
          };
          start?: {
              x?: number;
              y?: number;
          };
          serialize?: any;
      })[]

      All detected vertical lines in image space.

    • Optional Readonly verticalLinesNormalized?: (undefined | {
          end?: {
              x?: number;
              y?: number;
          };
          start?: {
              x?: number;
              y?: number;
          };
          serialize?: any;
      })[]

      Normalized vertical lines in image space.