capacitor-plugin-scanbot-sdk
    Preparing search index...

    Class DocumentDetectionResult

    Result of the document contour detection.

    Index

    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;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => { 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...;
              sizeScore?: number;
              totalScore?: number;
              widthScore?: number;
          };
          displacement?: DocumentDisplacement;
          displacementVector?: Point;
          horizontalLines?: {
              end?: Point;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
              start?: Point;
          }[];
          horizontalLinesNormalized?: {
              end?: Point;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
              start?: Point;
          }[];
          points?: Point[];
          pointsNormalized?: Point[];
          serialize?: (
              config?: ToJsonConfiguration,
          ) => { 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...;
          status?: DocumentDetectionStatus;
          verticalLines?: {
              end?: Point;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
              start?: Point;
          }[];
          verticalLinesNormalized?: {
              end?: Point;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => { readonly start?: Point | undefined; readonly end?: Point | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
              start?: Point;
          }[];
      }

      • Optional ReadonlyaspectRatio?: number

        Aspect ratio of the detected document contour.

      • Optional ReadonlyaverageBrightness?: 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 ReadonlydetectionScores?: {
            angleScore?: number;
            aspectRatioScore?: number;
            distanceScore?: number;
            heightScore?: number;
            lineCoverageScore?: number;
            serialize?: (
                config?: ToJsonConfiguration,
            ) => { 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...;
            sizeScore?: number;
            totalScore?: number;
            widthScore?: number;
        }

        The total and partial scores for the detected quad.

        • Optional ReadonlyangleScore?: number

          100 points, if all angles are 90 degrees.

        • Optional ReadonlyaspectRatioScore?: number

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

        • Optional ReadonlydistanceScore?: number

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

        • Optional ReadonlyheightScore?: number

          Percentage of the image height taken by the detected document.

        • Optional ReadonlylineCoverageScore?: number

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

        • Optionalserialize?: (
              config?: ToJsonConfiguration,
          ) => { 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 ReadonlysizeScore?: number

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

        • Optional ReadonlytotalScore?: number

          Weighted sum of all partial scores.

        • Optional ReadonlywidthScore?: number

          Percentage of the image width taken by the detected document.

      • Optional Readonlydisplacement?: DocumentDisplacement

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

        Default is NONE

      • Optional ReadonlydisplacementVector?: Point

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

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

        All detected horizontal lines in image space.

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

        Normalized horizontal lines in image space.

      • Optional Readonlypoints?: Point[]

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

      • Optional ReadonlypointsNormalized?: Point[]

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

      • Optionalserialize?: (
            config?: ToJsonConfiguration,
        ) => { 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 Readonlystatus?: DocumentDetectionStatus

        Detection status.

        Default is NOT_ACQUIRED

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

        All detected vertical lines in image space.

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

        Normalized vertical lines in image space.