Class DocumentStraighteningParameters

Configuration for document straightening.

Constructors

Properties

Methods

Constructors

Properties

aspectRatios: AspectRatio[]

By default, aspect ratio of the straightened document is automatically determined based on the detected document corners. If the document is significantly deformed, the estimated aspect ratio may be inaccurate. In such cases, providing a list of expected aspect ratios may help improve the accuracy of the straightening. The closest matching aspect ratio from the list will be used. Note, that if for a given paper format you want to support both portrait and landscape orientations, you need to provide both aspect ratios (e.g. 1:√2 and √2:1 for A series papers).

straighteningMode: DocumentStraighteningMode

Type of document straightening to apply.

Default is STRAIGHTEN

Methods

  • Parameters

    Returns {
        aspectRatios?: {
            height?: number;
            width?: number;
            serialize?(config?): { readonly width?: number | undefined; readonly height?: number | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
        }[];
        straighteningMode?: DocumentStraighteningMode;
        serialize?(config?): { straighteningMode?: DocumentStraighteningMode | undefined; aspectRatios?: { readonly width?: number | undefined; readonly height?: number | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; }[] | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | unde...;
    }

    • Optional aspectRatios?: {
          height?: number;
          width?: number;
          serialize?(config?): { readonly width?: number | undefined; readonly height?: number | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; };
      }[]

      By default, aspect ratio of the straightened document is automatically determined based on the detected document corners. If the document is significantly deformed, the estimated aspect ratio may be inaccurate. In such cases, providing a list of expected aspect ratios may help improve the accuracy of the straightening. The closest matching aspect ratio from the list will be used. Note, that if for a given paper format you want to support both portrait and landscape orientations, you need to provide both aspect ratios (e.g. 1:√2 and √2:1 for A series papers).

    • Optional straighteningMode?: DocumentStraighteningMode

      Type of document straightening to apply.

      Default is STRAIGHTEN

    • serialize?:function
      • Parameters

        Returns { straighteningMode?: DocumentStraighteningMode | undefined; aspectRatios?: { readonly width?: number | undefined; readonly height?: number | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | undefined; }[] | undefined; serialize?: ((config?: ToJsonConfiguration | undefined) => ...) | unde...