Result of the document contour detection.

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.

displacement: DocumentDisplacement

The direction towards the center of the document if the document is partially visible.

Default is NONE

displacementVector: Point

The direction vector towards the center of the document if the document is partially visible in normalized coordinates.

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?(config?): { readonly totalScore?: number | undefined; readonly distanceScore?: number | undefined; readonly angleScore?: number | undefined; readonly sizeScore?: number | undefined; readonly aspectRatioScore?: number | undefined; readonly lineCoverageScore?: number | undefined; readonly widthScore?: number | undefined; readon...;
        };
        displacement?: DocumentDisplacement;
        displacementVector?: Point;
        horizontalLines?: {
            end?: Point;
            start?: Point;
            serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
        }[];
        horizontalLinesNormalized?: {
            end?: Point;
            start?: Point;
            serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
        }[];
        points?: Point[];
        pointsNormalized?: Point[];
        status?: DocumentDetectionStatus;
        verticalLines?: {
            end?: Point;
            start?: Point;
            serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
        }[];
        verticalLinesNormalized?: {
            end?: Point;
            start?: Point;
            serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
        }[];
        serialize?(config?): { readonly status?: DocumentDetectionStatus | undefined; readonly detectionScores?: { readonly totalScore?: number | undefined; readonly distanceScore?: number | undefined; ... 6 more ...; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; } | undefined; ... 10 more ...; serialize?: ((confi...;
    }

    • 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?(config?): { readonly totalScore?: number | undefined; readonly distanceScore?: number | undefined; readonly angleScore?: number | undefined; readonly sizeScore?: number | undefined; readonly aspectRatioScore?: number | undefined; readonly lineCoverageScore?: number | undefined; readonly widthScore?: number | undefined; readon...;
      }

      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.

      • serialize?:function
        • Parameters

          Returns { readonly totalScore?: number | undefined; readonly distanceScore?: number | undefined; readonly angleScore?: number | undefined; readonly sizeScore?: number | undefined; readonly aspectRatioScore?: number | undefined; readonly lineCoverageScore?: number | undefined; readonly widthScore?: number | undefined; readon...

    • Optional Readonly displacement?: DocumentDisplacement

      The direction towards the center of the document if the document is partially visible.

      Default is NONE

    • Optional Readonly displacementVector?: Point

      The direction vector towards the center of the document if the document is partially visible in normalized coordinates.

    • Optional Readonly horizontalLines?: {
          end?: Point;
          start?: Point;
          serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
      }[]

      All detected horizontal lines in image space.

    • Optional Readonly horizontalLinesNormalized?: {
          end?: Point;
          start?: Point;
          serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
      }[]

      Normalized horizontal lines in image space.

    • Optional Readonly points?: Point[]

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

    • Optional Readonly pointsNormalized?: Point[]

      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?: {
          end?: Point;
          start?: Point;
          serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
      }[]

      All detected vertical lines in image space.

    • Optional Readonly verticalLinesNormalized?: {
          end?: Point;
          start?: Point;
          serialize?(config?): { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
      }[]

      Normalized vertical lines in image space.

    • serialize?:function
      • Parameters

        Returns { readonly status?: DocumentDetectionStatus | undefined; readonly detectionScores?: { readonly totalScore?: number | undefined; readonly distanceScore?: number | undefined; ... 6 more ...; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; } | undefined; ... 10 more ...; serialize?: ((confi...