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

    Class DocumentQualityAnalyzerResult

    Result of document quality analysis. It can be used to determine, e.g., if a document is good enough to be used for OCR processing.

    Index

    Constructors

    Properties

    cumulativeContrastHistogram: number[]

    Cumulative histogram where every entry is equal to the number of symbols with contrast equal or lower than N percent, where N is the index of the entry in the array.

    cumulativeQualityHistogram: number[]

    Cumulative histogram where every entry is equal to the number of symbols with quality equal or lower than N percent, where N is the index of the entry in the array.

    cumulativeTextSizeHistogram: number[]

    Cumulative histogram where every entry is equal to the number of symbols with text size equal or lower than N percent, where N is the index of the entry in the array.

    documentFound: boolean

    True if a document was found.

    orientation: number | null

    Dominant orientation of the document, if found and if orientation detection is enabled. The value is in degrees counter-clockwise, where 0 corresponds to the document being straight, and the value is in the range of [-180, 180]. To rotate the document to be straight, rotate the image clockwise by this value.

    orientationConfidence: number | null

    Confidence that the reported orientation of the document is correct. Returned if orientation detection is enabled. The value is in the range of [0, 1]. Possible reasons for low confidence are:

    • Document contains text with multiple orientations.
    • Text on the document is poorly readable.
    • Text on the document is on the edge of detectable text range (text is too small or too big).
    • Insufficient statistics because only part of the image was processed. See ProcessByTileConfiguration options in the DocumentQualityAnalyzerConfiguration.
    quality: DocumentQuality | null

    Quality of the document, if found.

    qualityHeatmap: ImageRef | null

    Quality heatmap. Black marks areas of no detected text. Colors represent the quality of detected text, with red meaning the lowest quality and yellow and green meaning progressively higher quality.

    Methods

    • Returns Promise<void>

    • Returns void

    • Parameters

      Returns Promise<
          {
              cumulativeContrastHistogram?: number[];
              cumulativeQualityHistogram?: number[];
              cumulativeTextSizeHistogram?: number[];
              documentFound?: boolean;
              encodeImages?: () => Promise<void>;
              orientation?: number | null;
              orientationConfidence?: number | null;
              quality?: DocumentQuality | null;
              qualityHeatmap?:
                  | {
                      buffer?: string;
                      clear?: () => Promise<void>;
                      encodeImage?: (options?: EncodeImageOptions) => Promise<string | null>;
                      encodeInPlace?: () => Promise<void>;
                      hibernate?: () => Promise<void>;
                      info?: () => Promise<ImageInfo | null>;
                      isRetained?: () => boolean;
                      release?: () => void;
                      retain?: () => void;
                      saveImage?: (
                          path: string,
                          options?: SaveImageOptions,
                      ) => Promise<boolean>;
                      serialize?: (
                          imageSerializationMode: ImageSerializationMode,
                      ) => Promise<
                          | (
                              { readonly uniqueId?: string | undefined; readonly buffer?: string | undefined; serialize?: ((imageSerializationMode: ImageSerializationMode) => Promise<(... & {}) | null>) | undefined; ... 8 more ...; retain?: (() => void) | undefined; } & {}
                          )
                          | null,
                      >;
                      uniqueId?: string;
                  } & {}
                  | null;
              release?: () => void;
              serialize?: (
                  config?: ToJsonConfiguration,
              ) => Promise<{ readonly documentFound?: boolean | undefined; readonly quality?: DocumentQuality | null | undefined; readonly orientation?: number | null | undefined; readonly orientationConfidence?: number | ... 1 more ... | undefined; ... 6 more ...; encodeImages?: (() => Promise<...>) | undefined; }>;
          },
      >