scanbot-web-sdk 6.0.0-dev.1 → 6.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/barcode-scanner-view.d.ts +10 -10
- package/@types/consume-type.d.ts +7 -0
- package/@types/core/bridge/common.d.ts +24 -0
- package/@types/core/bridge/compiled/BarcodeConfigs.d.ts +973 -0
- package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +183 -0
- package/@types/core/bridge/compiled/BarcodeTypes.d.ts +183 -0
- package/@types/core/bridge/compiled/CheckRecognizerTypes.d.ts +29 -0
- package/@types/core/bridge/compiled/CommonFieldType.d.ts +59 -0
- package/@types/core/bridge/compiled/DocumentDetectorTypes.d.ts +196 -0
- package/@types/core/bridge/compiled/DocumentQualityAnalyzerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled/EhicTypes.d.ts +218 -0
- package/@types/core/bridge/compiled/FrameUtilities.d.ts +18 -0
- package/@types/core/bridge/compiled/GenericDocument.d.ts +198 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +104 -0
- package/@types/core/bridge/compiled/GenericTextLineScannerTypes.d.ts +165 -0
- package/@types/core/bridge/compiled/Geometry.d.ts +49 -0
- package/@types/core/bridge/compiled/ImageProcessorTypes.d.ts +13 -0
- package/@types/core/bridge/compiled/LicensePlateScannerTypes.d.ts +67 -0
- package/@types/core/bridge/compiled/MRZTypes.d.ts +52 -0
- package/@types/core/bridge/compiled/MedicalCertificateTypes.d.ts +306 -0
- package/@types/core/bridge/compiled/OcrElements.d.ts +129 -0
- package/@types/core/bridge/compiled/ParametricFilters.d.ts +186 -0
- package/@types/core/bridge/compiled/PdfConfig.d.ts +197 -0
- package/@types/core/bridge/compiled/TiffTypes.d.ts +183 -0
- package/@types/core/bridge/compiled_schemas_v3/BarcodeConfigs.d.ts +973 -0
- package/@types/core/bridge/compiled_schemas_v3/BarcodeScannerTypes.d.ts +183 -0
- package/@types/core/bridge/compiled_schemas_v3/BarcodeTypes.d.ts +183 -0
- package/@types/core/bridge/compiled_schemas_v3/CheckRecognizerTypes.d.ts +29 -0
- package/@types/core/bridge/compiled_schemas_v3/CommonFieldType.d.ts +59 -0
- package/@types/core/bridge/compiled_schemas_v3/DocumentDetectorTypes.d.ts +196 -0
- package/@types/core/bridge/compiled_schemas_v3/DocumentQualityAnalyzerTypes.d.ts +105 -0
- package/@types/core/bridge/compiled_schemas_v3/EhicTypes.d.ts +218 -0
- package/@types/core/bridge/compiled_schemas_v3/FrameUtilities.d.ts +18 -0
- package/@types/core/bridge/compiled_schemas_v3/GenericDocument.d.ts +198 -0
- package/@types/core/bridge/compiled_schemas_v3/GenericDocumentRecognizerTypes.d.ts +104 -0
- package/@types/core/bridge/compiled_schemas_v3/GenericTextLineScannerTypes.d.ts +165 -0
- package/@types/core/bridge/compiled_schemas_v3/Geometry.d.ts +49 -0
- package/@types/core/bridge/compiled_schemas_v3/ImageProcessorTypes.d.ts +13 -0
- package/@types/core/bridge/compiled_schemas_v3/LicensePlateScannerTypes.d.ts +67 -0
- package/@types/core/bridge/compiled_schemas_v3/MRZTypes.d.ts +52 -0
- package/@types/core/bridge/compiled_schemas_v3/MedicalCertificateTypes.d.ts +306 -0
- package/@types/core/bridge/compiled_schemas_v3/OcrElements.d.ts +129 -0
- package/@types/core/bridge/compiled_schemas_v3/ParametricFilters.d.ts +186 -0
- package/@types/core/bridge/compiled_schemas_v3/PdfConfig.d.ts +197 -0
- package/@types/core/bridge/compiled_schemas_v3/TiffTypes.d.ts +183 -0
- package/@types/core/bridge/utils.d.ts +7 -0
- package/@types/core/bridge/worker-bridge.d.ts +362 -0
- package/@types/core/worker/ScanbotSDK.Core-simd-threads.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core-simd.d.ts +0 -0
- package/@types/core/worker/ScanbotSDK.Core.d.ts +75 -0
- package/@types/core-types.d.ts +23 -0
- package/@types/cropping-view.d.ts +4 -2
- package/@types/document-scanner-view.d.ts +5 -5
- package/@types/generic-document-recognizer-view.d.ts +22 -0
- package/@types/index.d.ts +12 -19
- package/@types/interfaces/i-document-scanner-handle.d.ts +2 -2
- package/@types/interfaces/i-generic-document-recognizer-scanner-handle.d.ts +3 -0
- package/@types/model/barcode/barcode-result.d.ts +6 -8
- package/@types/model/barcode/barcode.d.ts +3 -14
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +12 -8
- package/@types/model/configuration/cropping-view-configuration.d.ts +2 -1
- package/@types/model/configuration/document-scanner-configuration.d.ts +5 -20
- package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +9 -0
- package/@types/model/configuration/initialization-options.d.ts +2 -1
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +4 -3
- package/@types/model/configuration/scanner-configuration.d.ts +1 -0
- package/@types/model/configuration/selection-overlay-configuration.d.ts +2 -2
- package/@types/model/configuration/text-data-scanner-configuration.d.ts +3 -6
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +3 -2
- package/@types/model/configuration/vin-scanner-configuration.d.ts +2 -1
- package/@types/model/response/cropping-result.d.ts +2 -1
- package/@types/scanbot-sdk.d.ts +208 -29
- package/@types/service/document-quality-analyzer.d.ts +7 -5
- package/@types/service/generic-document-recognizer.d.ts +11 -0
- package/@types/service/ocr-engine.d.ts +8 -5
- package/@types/service/pdf-generator.d.ts +7 -95
- package/@types/service/public-utils.d.ts +1 -1
- package/@types/service/simple-mrz-recognizer.d.ts +5 -5
- package/@types/service/text-data-recognizer.d.ts +5 -4
- package/@types/service/tiff-generator.d.ts +12 -10
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +1 -1
- package/@types/ui2/configuration/BarcodeItem.d.ts +4 -28
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +12 -155
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +2 -18
- package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +6 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +0 -60
- package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -0
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +3 -0
- package/@types/ui2/configuration/CameraConfiguration.d.ts +22 -23
- package/@types/ui2/configuration/CameraPermission.d.ts +0 -15
- package/@types/ui2/configuration/Common.d.ts +0 -37
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +2 -2
- package/@types/ui2/configuration/Geometry.d.ts +1 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +1 -1
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +1 -1
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +0 -16
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +6 -3
- package/@types/ui2/configuration.d.ts +1 -1
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +2 -1
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +2 -1
- package/@types/ui2/model/counted-barcodes.d.ts +13 -12
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
- package/@types/ui2/utils/barcode-mapper.d.ts +15 -3
- package/@types/ui2/utils/camera-config.d.ts +2 -2
- package/@types/ui2/utils/styled-input.d.ts +1 -1
- package/@types/ui2/views/action-button/action-button-container.d.ts +2 -0
- package/@types/ui2/views/barcode-scanner.d.ts +4 -3
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +3 -3
- package/@types/ui2/views/form/dialog-button.d.ts +2 -2
- package/@types/utils/dto/MagneticLine.d.ts +4 -4
- package/@types/utils/dto/Point.d.ts +2 -2
- package/@types/utils/image-utils.d.ts +1 -0
- package/@types/utils/react/usePromise.d.ts +3 -1
- package/@types/utils/utils.d.ts +1 -1
- package/@types/utils/video-stream.d.ts +1 -0
- package/@types/view/action-bar/bottom-action-bar.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup-list.d.ts +2 -2
- package/@types/view/barcode-calculation/barcode-calculation-popup.d.ts +4 -4
- package/@types/view/barcode-calculation/scanned-image-with-overlay.d.ts +2 -2
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +6 -5
- package/@types/view/barcode-polygon/barcode-overlay.d.ts +3 -3
- package/@types/view/barcode-polygon/barcode-polygon-label.d.ts +2 -2
- package/@types/view/cropping/draggable-base-container.d.ts +8 -2
- package/@types/view/cropping/draggable-handles-component.d.ts +9 -2
- package/@types/view/view-finder.d.ts +1 -0
- package/@types/worker/worker-bridge.d.ts +349 -5
- package/Libraries.txt +307 -174
- package/README.md +3 -3
- package/bundle/ScanbotSDK.min.js +5 -5
- package/bundle/ScanbotSDK.ui2.min.js +108 -161
- package/bundle/ScanbotSDK.ui2.min.js.LICENSE.txt +0 -18
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +4 -3
- package/ui.d.ts +3 -0
- package/ui.js +2 -0
- package/webpack/fileLoader.js +3 -5
- package/@types/core/compiled/ParametricFilters.d.ts +0 -181
- package/@types/core/utils.d.ts +0 -1
- package/@types/core/worker-bridge.d.ts +0 -20
- package/@types/model/barcode/barcode-format.d.ts +0 -1
- package/@types/model/barcode/engine-mode.d.ts +0 -1
- package/@types/model/configuration/document-quality-analyzer-configuration.d.ts +0 -13
- package/@types/model/document/contour-detection-result.d.ts +0 -11
- package/@types/model/document/detection-status.d.ts +0 -11
- package/@types/model/document/document-detection-result.d.ts +0 -8
- package/@types/model/filter-types.d.ts +0 -6
- package/@types/model/generic-text-line-recognizer/text-data-scanner-result.d.ts +0 -6
- package/@types/model/mrz/mrz-result.d.ts +0 -41
- package/@types/model/response/document-quality-analyzer-result.d.ts +0 -8
- package/@types/service/image-processor.d.ts +0 -35
- package/@types/ui2/configuration/BarcodeResult.d.ts +0 -14
- package/@types/utils/networking.d.ts +0 -7
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm-webpack-file-loader +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm-webpack-file-loader +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { BarcodeConfig } from "./BarcodeConfigs";
|
|
2
|
+
import { BarcodeFormat } from "./BarcodeTypes";
|
|
3
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
4
|
+
import { GenericDocument } from "./GenericDocument";
|
|
5
|
+
import { Point } from "../common";
|
|
6
|
+
import { RawImage } from "../common";
|
|
7
|
+
/**
|
|
8
|
+
A single barcode found in the input image. Barcodes with the same content but different locations in the image are considered separate barcodes.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BarcodeItem extends PartiallyConstructible {
|
|
11
|
+
/**
|
|
12
|
+
Text contained in the barcode. Binary data is returned in the rawBytes field only.
|
|
13
|
+
*/
|
|
14
|
+
readonly text: string;
|
|
15
|
+
/**
|
|
16
|
+
Barcode format
|
|
17
|
+
@defaultValue "NONE";
|
|
18
|
+
*/
|
|
19
|
+
readonly format: BarcodeFormat;
|
|
20
|
+
/**
|
|
21
|
+
The four corners of the barcode in the input image, in clockwise order starting from the top left, in image coordinates.
|
|
22
|
+
*/
|
|
23
|
+
readonly quad: Point[];
|
|
24
|
+
/**
|
|
25
|
+
True if this is a 1D barcode that is printed upside-down, that is, the barcode was scanned right-to-left.
|
|
26
|
+
@defaultValue false;
|
|
27
|
+
*/
|
|
28
|
+
readonly isUpsideDown: boolean;
|
|
29
|
+
/**
|
|
30
|
+
A crop from the input image containing the barcode.
|
|
31
|
+
@defaultValue null;
|
|
32
|
+
*/
|
|
33
|
+
readonly sourceImage: RawImage | null;
|
|
34
|
+
/**
|
|
35
|
+
Raw bytes of barcode contents. Some formats can contain binary data, which is returned in this field.
|
|
36
|
+
*/
|
|
37
|
+
readonly rawBytes: Uint8Array;
|
|
38
|
+
/**
|
|
39
|
+
If this is a UPC/EAN barcode that has an EAN-2 or EAN-5 extension, this field contains the extension value. Requires the UPC_EAN_EXTENSION format to be enabled in the decoding options.
|
|
40
|
+
*/
|
|
41
|
+
readonly upcEanExtension: string;
|
|
42
|
+
/**
|
|
43
|
+
True if the barcode contains a GS1 message. Requires GS1 handling to be enabled in the decoding option.
|
|
44
|
+
@defaultValue false;
|
|
45
|
+
*/
|
|
46
|
+
readonly isGS1Message: boolean;
|
|
47
|
+
/**
|
|
48
|
+
True if this result is the 2D part of a GS1 Composite barcode.
|
|
49
|
+
Can only happen if GS1_COMPOSITE scanning is disabled and a part of the composite (1D) or (2D) is scanned separately.
|
|
50
|
+
When GS1_COMPOSITE scanning is enabled, parts of the composite barcode are never returned separately, even if their respective
|
|
51
|
+
format is enabled in the decoding options.
|
|
52
|
+
@defaultValue false;
|
|
53
|
+
*/
|
|
54
|
+
readonly isGS1CompositePart: boolean;
|
|
55
|
+
/**
|
|
56
|
+
The number of 1D stacks in the barcode. Applies only to DATABAR and DATABAR_EXPANDED barcodes.
|
|
57
|
+
@defaultValue 1;
|
|
58
|
+
*/
|
|
59
|
+
readonly dataBarStackSize: number;
|
|
60
|
+
/**
|
|
61
|
+
The parsed known document format (if parsed successfully).
|
|
62
|
+
*/
|
|
63
|
+
readonly parsedDocument: GenericDocument | null;
|
|
64
|
+
/** @param source {@displayType `DeepPartial<BarcodeItem>`} */
|
|
65
|
+
constructor(source?: DeepPartial<BarcodeItem>);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
The engine mode for barcode scanning
|
|
69
|
+
|
|
70
|
+
- `LEGACY`:
|
|
71
|
+
Legacy mode. Very fast, significantly less accurate. Doesn't support all barcode types
|
|
72
|
+
- `NEXT_GEN_LOW_POWER`:
|
|
73
|
+
A faster version of the main engine mode, for use with low-power devices.
|
|
74
|
+
- `NEXT_GEN`:
|
|
75
|
+
Main engine mode. Supports all barcodes types. Typically produces results faster than NEXT_GEN_LOW_POWER on most devices in live mode.
|
|
76
|
+
- `NEXT_GEN_AR`:
|
|
77
|
+
Similar to NEXT_GEN, but optimized for AR.
|
|
78
|
+
*/
|
|
79
|
+
export type EngineMode = "LEGACY" | "NEXT_GEN_LOW_POWER" | "NEXT_GEN" | "NEXT_GEN_AR";
|
|
80
|
+
/**
|
|
81
|
+
Type of barcode document format used.
|
|
82
|
+
|
|
83
|
+
- `AAMVA`:
|
|
84
|
+
American Association of Motor Vehicle Administrators barcode document
|
|
85
|
+
- `BOARDING_PASS`:
|
|
86
|
+
Boarding pass barcode document
|
|
87
|
+
- `DE_MEDICAL_PLAN`:
|
|
88
|
+
German medication plan barcode document
|
|
89
|
+
- `MEDICAL_CERTIFICATE`:
|
|
90
|
+
German medical certificate barcode document
|
|
91
|
+
- `ID_CARD_PDF_417`:
|
|
92
|
+
ID card barcode document
|
|
93
|
+
- `SEPA`:
|
|
94
|
+
SEPA barcode (aka GiroCode) document
|
|
95
|
+
- `SWISS_QR`:
|
|
96
|
+
Swiss QR barcode document
|
|
97
|
+
- `VCARD`:
|
|
98
|
+
VCard barcode document
|
|
99
|
+
- `GS1`:
|
|
100
|
+
GS1 barcode document
|
|
101
|
+
- `HIBC`:
|
|
102
|
+
Health industry barcode document
|
|
103
|
+
*/
|
|
104
|
+
export type BarcodeDocumentFormat = "AAMVA" | "BOARDING_PASS" | "DE_MEDICAL_PLAN" | "MEDICAL_CERTIFICATE" | "ID_CARD_PDF_417" | "SEPA" | "SWISS_QR" | "VCARD" | "GS1" | "HIBC";
|
|
105
|
+
/**
|
|
106
|
+
Barcode document formats
|
|
107
|
+
*/
|
|
108
|
+
export declare class BarcodeDocumentFormats extends PartiallyConstructible {
|
|
109
|
+
/** @param source {@displayType `DeepPartial<BarcodeDocumentFormats>`} */
|
|
110
|
+
constructor(source?: DeepPartial<BarcodeDocumentFormats>);
|
|
111
|
+
}
|
|
112
|
+
export declare namespace BarcodeDocumentFormats {
|
|
113
|
+
/**
|
|
114
|
+
All barcode document formats
|
|
115
|
+
@defaultValue ["AAMVA", "BOARDING_PASS", "DE_MEDICAL_PLAN", "MEDICAL_CERTIFICATE", "ID_CARD_PDF_417", "SEPA", "SWISS_QR", "VCARD", "GS1", "HIBC"];
|
|
116
|
+
*/
|
|
117
|
+
const all: BarcodeDocumentFormat[];
|
|
118
|
+
/**
|
|
119
|
+
Barcode types that are used to encode documents
|
|
120
|
+
@defaultValue {
|
|
121
|
+
"AAMVA": ["PDF_417"],
|
|
122
|
+
"ID_CARD_PDF_417": ["PDF_417"],
|
|
123
|
+
"SEPA": ["QR_CODE"],
|
|
124
|
+
"MEDICAL_CERTIFICATE": ["PDF_417"],
|
|
125
|
+
"DE_MEDICAL_PLAN": ["DATA_MATRIX"],
|
|
126
|
+
"BOARDING_PASS": ["PDF_417", "AZTEC"],
|
|
127
|
+
"VCARD": ["QR_CODE"],
|
|
128
|
+
"SWISS_QR": ["QR_CODE"],
|
|
129
|
+
"GS1": ["CODE_128", "AZTEC", "DATA_MATRIX", "DATABAR", "DATABAR_EXPANDED", "DATABAR_LIMITED", "EAN_13", "EAN_8", "GS1_COMPOSITE", "ITF", "MICRO_PDF_417", "PDF_417", "QR_CODE", "UPC_A", "UPC_E"],
|
|
130
|
+
"HIBC": ["CODE_39", "CODE_128", "AZTEC", "DATA_MATRIX", "MICRO_PDF_417", "PDF_417", "QR_CODE"]
|
|
131
|
+
};
|
|
132
|
+
*/
|
|
133
|
+
const documentBarcodeFormats: {
|
|
134
|
+
[key in BarcodeDocumentFormat]: BarcodeFormat[];
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
Parameters for barcode recognition
|
|
139
|
+
*/
|
|
140
|
+
export declare class BarcodeRecognizerParameters extends PartiallyConstructible {
|
|
141
|
+
/**
|
|
142
|
+
Options for barcode decoding
|
|
143
|
+
@defaultValue [new GroupCommonConfig({})];
|
|
144
|
+
*/
|
|
145
|
+
configurators: BarcodeConfig[];
|
|
146
|
+
/**
|
|
147
|
+
The engine mode for barcode scanning
|
|
148
|
+
@defaultValue "NEXT_GEN";
|
|
149
|
+
*/
|
|
150
|
+
engineMode: EngineMode;
|
|
151
|
+
/**
|
|
152
|
+
If true, the barcode recognition will be performed in live mode
|
|
153
|
+
@defaultValue true;
|
|
154
|
+
*/
|
|
155
|
+
live: boolean;
|
|
156
|
+
/**
|
|
157
|
+
List of accepted barcode document formats.
|
|
158
|
+
@defaultValue ["AAMVA", "BOARDING_PASS", "DE_MEDICAL_PLAN", "MEDICAL_CERTIFICATE", "ID_CARD_PDF_417", "SEPA", "SWISS_QR", "VCARD", "GS1", "HIBC"];
|
|
159
|
+
*/
|
|
160
|
+
acceptedDocumentFormats: BarcodeDocumentFormat[];
|
|
161
|
+
/**
|
|
162
|
+
If true, the barcode image will be returned in the BarcodeItem
|
|
163
|
+
@defaultValue true;
|
|
164
|
+
*/
|
|
165
|
+
returnBarcodeImage: boolean;
|
|
166
|
+
/** @param source {@displayType `DeepPartial<BarcodeRecognizerParameters>`} */
|
|
167
|
+
constructor(source?: DeepPartial<BarcodeRecognizerParameters>);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
The result of barcode scanning
|
|
171
|
+
*/
|
|
172
|
+
export declare class BarcodeScannerResult extends PartiallyConstructible {
|
|
173
|
+
/**
|
|
174
|
+
List of found barcodes
|
|
175
|
+
*/
|
|
176
|
+
readonly barcodes: BarcodeItem[];
|
|
177
|
+
/**
|
|
178
|
+
True if any barcodes were found
|
|
179
|
+
*/
|
|
180
|
+
readonly success: boolean;
|
|
181
|
+
/** @param source {@displayType `DeepPartial<BarcodeScannerResult>`} */
|
|
182
|
+
constructor(source?: DeepPartial<BarcodeScannerResult>);
|
|
183
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
2
|
+
/**
|
|
3
|
+
Enumerates barcode formats.
|
|
4
|
+
|
|
5
|
+
- `NONE`:
|
|
6
|
+
Used as a return value if no valid barcode has been detected
|
|
7
|
+
- `AZTEC`:
|
|
8
|
+
Aztec (2D)
|
|
9
|
+
- `CODABAR`:
|
|
10
|
+
CODABAR (1D)
|
|
11
|
+
- `CODE_39`:
|
|
12
|
+
Code 39 (1D)
|
|
13
|
+
- `CODE_93`:
|
|
14
|
+
Code 93 (1D)
|
|
15
|
+
- `CODE_128`:
|
|
16
|
+
Code 128 (1D)
|
|
17
|
+
- `DATA_MATRIX`:
|
|
18
|
+
Data Matrix (2D)
|
|
19
|
+
- `EAN_8`:
|
|
20
|
+
EAN-8 (1D)
|
|
21
|
+
- `EAN_13`:
|
|
22
|
+
EAN-13 (1D)
|
|
23
|
+
- `ITF`:
|
|
24
|
+
ITF (Interleaved Two of Five) (1D)
|
|
25
|
+
- `MAXICODE`:
|
|
26
|
+
MaxiCode (2D)
|
|
27
|
+
- `PDF_417`:
|
|
28
|
+
PDF417 (2D)
|
|
29
|
+
- `QR_CODE`:
|
|
30
|
+
QR Code (2D)
|
|
31
|
+
- `DATABAR`:
|
|
32
|
+
GS1 DataBar-14 (formerly RSS-14) (1D)
|
|
33
|
+
- `DATABAR_EXPANDED`:
|
|
34
|
+
GS1 DataBar Expanded (formerly RSS Expanded) (1D)
|
|
35
|
+
- `UPC_A`:
|
|
36
|
+
UPC-A (1D)
|
|
37
|
+
- `UPC_E`:
|
|
38
|
+
UPC-E (1D)
|
|
39
|
+
- `MSI_PLESSEY`:
|
|
40
|
+
MSI PLESSEY
|
|
41
|
+
- `IATA_2_OF_5`:
|
|
42
|
+
IATA 2 of 5 (1D)
|
|
43
|
+
- `INDUSTRIAL_2_OF_5`:
|
|
44
|
+
INDUSTRIAL 2 of 5 (1D)
|
|
45
|
+
- `CODE_25`:
|
|
46
|
+
CODE 25 (1D)
|
|
47
|
+
- `MICRO_QR_CODE`:
|
|
48
|
+
Micro QR Code (2D)
|
|
49
|
+
- `USPS_INTELLIGENT_MAIL`:
|
|
50
|
+
USPS Intelligent Mail, a.k.a. USPS OneCode, USPS-STD-11
|
|
51
|
+
- `ROYAL_MAIL`:
|
|
52
|
+
Royal Mail Four-State Customer Code, a.k.a. RM4SCC, CBC, BPO 4 State Code
|
|
53
|
+
- `JAPAN_POST`:
|
|
54
|
+
Japan Post Four-State Barcode
|
|
55
|
+
- `ROYAL_TNT_POST`:
|
|
56
|
+
Royal TNT Post Four-State Barcode, a.k.a. KIX, Klant IndeX
|
|
57
|
+
- `AUSTRALIA_POST`:
|
|
58
|
+
Australia Post Four-State Customer Code
|
|
59
|
+
- `DATABAR_LIMITED`:
|
|
60
|
+
GS1 DataBar Limited
|
|
61
|
+
- `MICRO_PDF_417`:
|
|
62
|
+
Micro PDF417 (2D)
|
|
63
|
+
- `GS1_COMPOSITE`:
|
|
64
|
+
GS1 COMPOSITE (combined linear and 2D).
|
|
65
|
+
- `RMQR_CODE`:
|
|
66
|
+
Rectangular Micro QR Code (2D)
|
|
67
|
+
- `CODE_11`:
|
|
68
|
+
Code 11 (1D)
|
|
69
|
+
- `CODE_32`:
|
|
70
|
+
Code 32 (Italian Pharmacode) (1D)
|
|
71
|
+
- `PHARMA_CODE`:
|
|
72
|
+
Pharmacode, a.k.a. One-Track Pharmacode, Pharmaceutical Binary Code (1D)
|
|
73
|
+
- `PHARMA_CODE_TWO_TRACK`:
|
|
74
|
+
Two-Track Pharmacode, a.k.a. Pharmaceutical Binary Code
|
|
75
|
+
- `PZN`:
|
|
76
|
+
Pharmazentralnummer, a.k.a. PZN, PZN8, German Pharmaceutical Central Number (1D)
|
|
77
|
+
*/
|
|
78
|
+
export type BarcodeFormat = "NONE" | "AZTEC" | "CODABAR" | "CODE_39" | "CODE_93" | "CODE_128" | "DATA_MATRIX" | "EAN_8" | "EAN_13" | "ITF" | "MAXICODE" | "PDF_417" | "QR_CODE" | "DATABAR" | "DATABAR_EXPANDED" | "UPC_A" | "UPC_E" | "MSI_PLESSEY" | "IATA_2_OF_5" | "INDUSTRIAL_2_OF_5" | "CODE_25" | "MICRO_QR_CODE" | "USPS_INTELLIGENT_MAIL" | "ROYAL_MAIL" | "JAPAN_POST" | "ROYAL_TNT_POST" | "AUSTRALIA_POST" | "DATABAR_LIMITED" | "MICRO_PDF_417" | "GS1_COMPOSITE" | "RMQR_CODE" | "CODE_11" | "CODE_32" | "PHARMA_CODE" | "PHARMA_CODE_TWO_TRACK" | "PZN";
|
|
79
|
+
/**
|
|
80
|
+
Lists of barcode formats to decode
|
|
81
|
+
*/
|
|
82
|
+
export declare class BarcodeFormats extends PartiallyConstructible {
|
|
83
|
+
/** @param source {@displayType `DeepPartial<BarcodeFormats>`} */
|
|
84
|
+
constructor(source?: DeepPartial<BarcodeFormats>);
|
|
85
|
+
}
|
|
86
|
+
export declare namespace BarcodeFormats {
|
|
87
|
+
/**
|
|
88
|
+
List of 1D barcode formats
|
|
89
|
+
@defaultValue ["CODABAR", "CODE_11", "CODE_25", "CODE_32", "CODE_39", "CODE_93", "CODE_128", "DATABAR", "DATABAR_EXPANDED", "DATABAR_LIMITED", "EAN_8", "EAN_13", "IATA_2_OF_5", "INDUSTRIAL_2_OF_5", "ITF", "MSI_PLESSEY", "PHARMA_CODE", "PZN", "UPC_A", "UPC_E"];
|
|
90
|
+
*/
|
|
91
|
+
const oned: BarcodeFormat[];
|
|
92
|
+
/**
|
|
93
|
+
List of 2D barcode formats
|
|
94
|
+
@defaultValue ["AZTEC", "DATA_MATRIX", "MAXICODE", "MICRO_QR_CODE", "MICRO_PDF_417", "PDF_417", "QR_CODE", "RMQR_CODE"];
|
|
95
|
+
*/
|
|
96
|
+
const twod: BarcodeFormat[];
|
|
97
|
+
/**
|
|
98
|
+
List of postal barcode formats
|
|
99
|
+
@defaultValue ["AUSTRALIA_POST", "JAPAN_POST", "ROYAL_MAIL", "ROYAL_TNT_POST", "USPS_INTELLIGENT_MAIL"];
|
|
100
|
+
*/
|
|
101
|
+
const postal: BarcodeFormat[];
|
|
102
|
+
/**
|
|
103
|
+
List of pharmaceutical barcode formats
|
|
104
|
+
@defaultValue ["CODE_32", "PHARMA_CODE", "PHARMA_CODE_TWO_TRACK", "PZN"];
|
|
105
|
+
*/
|
|
106
|
+
const pharma: BarcodeFormat[];
|
|
107
|
+
/**
|
|
108
|
+
List of common barcode formats
|
|
109
|
+
@defaultValue ["AZTEC", "CODABAR", "CODE_39", "CODE_93", "CODE_128", "DATA_MATRIX", "DATABAR", "DATABAR_EXPANDED", "DATABAR_LIMITED", "EAN_13", "EAN_8", "ITF", "MICRO_QR_CODE", "PDF_417", "QR_CODE", "UPC_A", "UPC_E"];
|
|
110
|
+
*/
|
|
111
|
+
const common: BarcodeFormat[];
|
|
112
|
+
/**
|
|
113
|
+
List of all barcode formats
|
|
114
|
+
@defaultValue ["AUSTRALIA_POST", "AZTEC", "CODABAR", "CODE_11", "CODE_25", "CODE_32", "CODE_39", "CODE_93", "CODE_128", "DATA_MATRIX", "DATABAR", "DATABAR_EXPANDED", "DATABAR_LIMITED", "EAN_13", "EAN_8", "GS1_COMPOSITE", "IATA_2_OF_5", "INDUSTRIAL_2_OF_5", "ITF", "JAPAN_POST", "MAXICODE", "MICRO_PDF_417", "MICRO_QR_CODE", "MSI_PLESSEY", "PDF_417", "PHARMA_CODE", "PHARMA_CODE_TWO_TRACK", "PZN", "QR_CODE", "RMQR_CODE", "ROYAL_MAIL", "ROYAL_TNT_POST", "UPC_A", "UPC_E", "USPS_INTELLIGENT_MAIL"];
|
|
115
|
+
*/
|
|
116
|
+
const all: BarcodeFormat[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
GS1 message handling options.
|
|
120
|
+
The GS1 standard defines a a key-value format for business-centric data that can be encoded into many 1D and 2D barcode types.
|
|
121
|
+
https://ref.gs1.org/standards/genspecs/
|
|
122
|
+
|
|
123
|
+
GS1 messages have two representations or formats: a human-readable format and a
|
|
124
|
+
machine-readable format. The human-readable format uses parentheses to wrap the keys in each
|
|
125
|
+
pair. For example, the string "(01)012345678901(37)02(3922)00278" contains three AI keys:
|
|
126
|
+
01, 37, and 3922. The corresponding values are 012345678901, 02, and 00278.
|
|
127
|
+
|
|
128
|
+
The machine-readable format uses the special ASCII \x1D character to terminate key-value
|
|
129
|
+
pairs in the string in cases where the given key implies that the value is variable-length.
|
|
130
|
+
The equivalent machine-readable string for the above example is
|
|
131
|
+
"010123456789013702\x1D392200278".
|
|
132
|
+
In the above example, the 01 AI key is fixed-length, so the \x1D character is not necessary.
|
|
133
|
+
The 37 AI keys is variable-length, so the \x1D character is necessary after the value in the
|
|
134
|
+
pair. The 3922 AI key is also variable-length, but it is the last pair in the message, so
|
|
135
|
+
the \x1D character is not necessary at the end.
|
|
136
|
+
|
|
137
|
+
The character \x1D is UNPRINTABLE - this means that if you try to print or otherwise
|
|
138
|
+
visualize a GS1 message containing the \x1D character, you may see a number of different
|
|
139
|
+
results, depending on how the system handles unprintable characters. You may see a question
|
|
140
|
+
mark, a box, an escape sequence, a space or nothing at all.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
- `NONE`:
|
|
144
|
+
The (FNC1) character is simply stripped from the result in barcodes that implement this
|
|
145
|
+
mode.
|
|
146
|
+
Do not use. Will be removed in a future release.
|
|
147
|
+
- `PARSE`:
|
|
148
|
+
This is the default. GS1 messages are converted to the machine-readable format per
|
|
149
|
+
the GS1 spec (the special FNC1 character is converted to ASCII \x1D).
|
|
150
|
+
The implied 01 AI key is prepended to DataBar results.
|
|
151
|
+
No validation is performed.
|
|
152
|
+
- `VALIDATE_STRUCTURE`:
|
|
153
|
+
Same as PARSE. Additionally, messages containing unknown AI keys, or containing values
|
|
154
|
+
that don't fulfill the length, character set or regex requirements for known keys, are rejected.
|
|
155
|
+
- `DECODE_STRUCTURE`:
|
|
156
|
+
Same as VALIDATE_STRUCTURE. Additionally, GS1 strings are converted to the human-readable format,
|
|
157
|
+
instead (with parentheses used to wrap AI keys, e.g. "(01)123456789"). The \x1D character is
|
|
158
|
+
never used in this representation.
|
|
159
|
+
- `VALIDATE_FULL`:
|
|
160
|
+
Includes all validations from VALIDATE_STRUCTURE. Additionally, GS1 messages which have missing or incompatible combinations of AI keys are rejected. Additionally, values are checked against a list of known linting rules, e.g. checksums are calculated and verified, dates are checked for validity, etc. Results that fail any of the linter rules are rejected. The complete set of linter rules from the GS1 Syntax Dictionary are implemented.
|
|
161
|
+
- `DECODE_FULL`:
|
|
162
|
+
Combines the validations of VALIDATE_FULL and the human-readable output format of DECODE_STRUCTURE.
|
|
163
|
+
*/
|
|
164
|
+
export type GS1Handling = "NONE" | "PARSE" | "VALIDATE_STRUCTURE" | "DECODE_STRUCTURE" | "VALIDATE_FULL" | "DECODE_FULL";
|
|
165
|
+
/**
|
|
166
|
+
Behavior when scanning UPC/EAN barcodes with EAN-2 or EAN-5 extensions.
|
|
167
|
+
|
|
168
|
+
- `Require2`:
|
|
169
|
+
Only barcodes with a 2-digit extension are accepted.
|
|
170
|
+
- `Require5`:
|
|
171
|
+
Only barcodes with a 5-digit extension are accepted.
|
|
172
|
+
- `RequireAny`:
|
|
173
|
+
Only barcodes with either a 2-digit or a 5-digit extension are accepted.
|
|
174
|
+
- `Ignore`:
|
|
175
|
+
Always ignore the extension.
|
|
176
|
+
- `Allow2`:
|
|
177
|
+
Return detected 2-digit extension if present, but do not require it. Ignore the 5-digit extension.
|
|
178
|
+
- `Allow5`:
|
|
179
|
+
Return detected 5-digit extension if present, but do not require it. Ignore the 2-digit extension.
|
|
180
|
+
- `AllowAny`:
|
|
181
|
+
Return any detected extension if present, but do not require it.
|
|
182
|
+
*/
|
|
183
|
+
export type UpcEanExtensionBehavior = "Require2" | "Require5" | "RequireAny" | "Ignore" | "Allow2" | "Allow5" | "AllowAny";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
2
|
+
import { GenericDocument } from "./GenericDocument";
|
|
3
|
+
/**
|
|
4
|
+
Check Recognizer Status
|
|
5
|
+
|
|
6
|
+
- `SUCCESS`:
|
|
7
|
+
Recognition successful
|
|
8
|
+
- `VALIDATION_FAILED`:
|
|
9
|
+
A check was recognized, but validation failed, indication a standard violation, unsupported standard, or recognition error
|
|
10
|
+
- `FAIL`:
|
|
11
|
+
No check was recognized
|
|
12
|
+
*/
|
|
13
|
+
export type RecognitionStatus = "SUCCESS" | "VALIDATION_FAILED" | "FAIL";
|
|
14
|
+
/**
|
|
15
|
+
The result of check recognition
|
|
16
|
+
*/
|
|
17
|
+
export declare class RecognitionResult extends PartiallyConstructible {
|
|
18
|
+
/**
|
|
19
|
+
Check recognizer status
|
|
20
|
+
@defaultValue "FAIL";
|
|
21
|
+
*/
|
|
22
|
+
readonly status: RecognitionStatus;
|
|
23
|
+
/**
|
|
24
|
+
Generic document containing check data. Not present, if status is FAIL.
|
|
25
|
+
*/
|
|
26
|
+
readonly check: GenericDocument | null;
|
|
27
|
+
/** @param source {@displayType `DeepPartial<RecognitionResult>`} */
|
|
28
|
+
constructor(source?: DeepPartial<RecognitionResult>);
|
|
29
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Common field types
|
|
3
|
+
|
|
4
|
+
- `ID`:
|
|
5
|
+
Document ID
|
|
6
|
+
- `SURNAME`:
|
|
7
|
+
Person surname field
|
|
8
|
+
- `MAIDEN_NAME`:
|
|
9
|
+
Person maiden name field
|
|
10
|
+
- `GIVEN_NAMES`:
|
|
11
|
+
Person given names field
|
|
12
|
+
- `BIRTH_DATE`:
|
|
13
|
+
Person birth date field
|
|
14
|
+
- `NATIONALITY`:
|
|
15
|
+
Person nationality field
|
|
16
|
+
- `BIRTHPLACE`:
|
|
17
|
+
Person birthplace field
|
|
18
|
+
- `EXPIRY_DATE`:
|
|
19
|
+
Document expiry date field
|
|
20
|
+
- `EYE_COLOR`:
|
|
21
|
+
Person height field
|
|
22
|
+
- `HEIGHT`:
|
|
23
|
+
Person height field
|
|
24
|
+
- `ISSUE_DATE`:
|
|
25
|
+
Document issue date field
|
|
26
|
+
- `ISSUING_AUTHORITY`:
|
|
27
|
+
Document issuing authority field
|
|
28
|
+
- `ADDRESS`:
|
|
29
|
+
Address field
|
|
30
|
+
- `PSEUDONYM`:
|
|
31
|
+
Pseudonym field
|
|
32
|
+
- `MRZ`:
|
|
33
|
+
MRZ field
|
|
34
|
+
- `COUNTRY_CODE`:
|
|
35
|
+
Country code (ISO-3166 Alpha-3) field
|
|
36
|
+
- `GENDER`:
|
|
37
|
+
Gender field
|
|
38
|
+
- `SIGNATURE`:
|
|
39
|
+
Signature field
|
|
40
|
+
- `PHOTO`:
|
|
41
|
+
Photo field
|
|
42
|
+
- `VALID_FROM_DATE`:
|
|
43
|
+
Date of start of validity field
|
|
44
|
+
- `ROUTING_NUMBER`:
|
|
45
|
+
Check routing number
|
|
46
|
+
- `ACCOUNT_NUMBER`:
|
|
47
|
+
Check account number
|
|
48
|
+
- `PLACE_OF_ISSUE`:
|
|
49
|
+
Place of issue for the identity card
|
|
50
|
+
- `TITLE_TYPE`:
|
|
51
|
+
Type of the title field in the identity document
|
|
52
|
+
- `REMARKS`:
|
|
53
|
+
Remarks field in the identity document
|
|
54
|
+
- `NAME`:
|
|
55
|
+
Full name field
|
|
56
|
+
- `CARD_ACCESS_NUMBER`:
|
|
57
|
+
Card access number field
|
|
58
|
+
*/
|
|
59
|
+
export type CommonFieldType = "ID" | "SURNAME" | "MAIDEN_NAME" | "GIVEN_NAMES" | "BIRTH_DATE" | "NATIONALITY" | "BIRTHPLACE" | "EXPIRY_DATE" | "EYE_COLOR" | "HEIGHT" | "ISSUE_DATE" | "ISSUING_AUTHORITY" | "ADDRESS" | "PSEUDONYM" | "MRZ" | "COUNTRY_CODE" | "GENDER" | "SIGNATURE" | "PHOTO" | "VALID_FROM_DATE" | "ROUTING_NUMBER" | "ACCOUNT_NUMBER" | "PLACE_OF_ISSUE" | "TITLE_TYPE" | "REMARKS" | "NAME" | "CARD_ACCESS_NUMBER";
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { AspectRatio } from "./Geometry";
|
|
2
|
+
import { DeepPartial, PartiallyConstructible } from "../common";
|
|
3
|
+
import { LineSegmentFloat } from "./Geometry";
|
|
4
|
+
import { LineSegmentInt } from "./Geometry";
|
|
5
|
+
import { Point } from "../common";
|
|
6
|
+
import { Rectangle } from "../common";
|
|
7
|
+
/**
|
|
8
|
+
Engines for document detection
|
|
9
|
+
|
|
10
|
+
- `ML`:
|
|
11
|
+
Use the ML document detector
|
|
12
|
+
- `LEGACY`:
|
|
13
|
+
Use the legacy edge-based document detector
|
|
14
|
+
*/
|
|
15
|
+
export type EngineMode = "ML" | "LEGACY";
|
|
16
|
+
/**
|
|
17
|
+
Parameters for the document detector
|
|
18
|
+
*/
|
|
19
|
+
export declare class DetectionParameters extends PartiallyConstructible {
|
|
20
|
+
/**
|
|
21
|
+
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document.
|
|
22
|
+
Set lower values to accept more perspective distortion.
|
|
23
|
+
|
|
24
|
+
Warning: Lower values result in more blurred document images.
|
|
25
|
+
@defaultValue 75.0;
|
|
26
|
+
*/
|
|
27
|
+
acceptedAngleScore: number;
|
|
28
|
+
/**
|
|
29
|
+
The minimum size in percent (0 - 100) of the screen size to accept a detected document.
|
|
30
|
+
It is sufficient that height or width match the score.
|
|
31
|
+
|
|
32
|
+
Warning: Lower values result in low resolution document images.
|
|
33
|
+
@defaultValue 80.0;
|
|
34
|
+
*/
|
|
35
|
+
acceptedSizeScore: number;
|
|
36
|
+
/**
|
|
37
|
+
The minimum brightness value (0-255) to accept a detected document.
|
|
38
|
+
@defaultValue 0;
|
|
39
|
+
*/
|
|
40
|
+
acceptedBrightnessThreshold: number;
|
|
41
|
+
/**
|
|
42
|
+
The required aspect ratios for the detected document.
|
|
43
|
+
A document matches if its aspect ratio matches any of the given aspect ratios.
|
|
44
|
+
If empty, no aspect ratio is required.
|
|
45
|
+
@defaultValue [];
|
|
46
|
+
*/
|
|
47
|
+
requiredAspectRatios: AspectRatio[];
|
|
48
|
+
/**
|
|
49
|
+
The rectangle of interest in normalized coordinates.
|
|
50
|
+
The document detector will only search for documents in this area.
|
|
51
|
+
If the rectangle is empty, the whole image is used.
|
|
52
|
+
@defaultValue {
|
|
53
|
+
"x": 0,
|
|
54
|
+
"y": 0,
|
|
55
|
+
"width": 0,
|
|
56
|
+
"height": 0
|
|
57
|
+
};
|
|
58
|
+
*/
|
|
59
|
+
rectangleOfInterest: Rectangle;
|
|
60
|
+
/** @param source {@displayType `DeepPartial<DetectionParameters>`} */
|
|
61
|
+
constructor(source?: DeepPartial<DetectionParameters>);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
Configuration for the document detector
|
|
65
|
+
*/
|
|
66
|
+
export declare class DetectorConfiguration extends PartiallyConstructible {
|
|
67
|
+
/**
|
|
68
|
+
The engine to use for document detection
|
|
69
|
+
@defaultValue "ML";
|
|
70
|
+
*/
|
|
71
|
+
engineMode: EngineMode;
|
|
72
|
+
/**
|
|
73
|
+
Initial parameters for the document detector
|
|
74
|
+
@defaultValue new DetectionParameters({});
|
|
75
|
+
*/
|
|
76
|
+
parameters: DetectionParameters;
|
|
77
|
+
/** @param source {@displayType `DeepPartial<DetectorConfiguration>`} */
|
|
78
|
+
constructor(source?: DeepPartial<DetectorConfiguration>);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
Status of the document contour detection
|
|
82
|
+
|
|
83
|
+
- `NOT_ACQUIRED`:
|
|
84
|
+
Detection has not yet happened
|
|
85
|
+
- `OK`:
|
|
86
|
+
An acceptable polygon was detected
|
|
87
|
+
- `OK_SMALL_SIZE`:
|
|
88
|
+
A polygon was detected, but it has too much perspective distortion
|
|
89
|
+
- `OK_BAD_ANGLES`:
|
|
90
|
+
A polygon was detected, but its aspect ratio should be landscape/portrait but is portrait/landscape
|
|
91
|
+
- `OK_BAD_ASPECT_RATIO`:
|
|
92
|
+
A polygon was detected, but its aspect ratio is not within the expected range
|
|
93
|
+
- `OK_OFF_CENTER`:
|
|
94
|
+
A polygon was detected, but its center is too far away from the image center.
|
|
95
|
+
- `ERROR_NOTHING_DETECTED`:
|
|
96
|
+
No polygon was detected
|
|
97
|
+
- `ERROR_TOO_DARK`:
|
|
98
|
+
The image is too dark
|
|
99
|
+
- `ERROR_NOISE`:
|
|
100
|
+
The image is too noisy (background)
|
|
101
|
+
*/
|
|
102
|
+
export type DetectionStatus = "NOT_ACQUIRED" | "OK" | "OK_SMALL_SIZE" | "OK_BAD_ANGLES" | "OK_BAD_ASPECT_RATIO" | "OK_OFF_CENTER" | "ERROR_NOTHING_DETECTED" | "ERROR_TOO_DARK" | "ERROR_NOISE";
|
|
103
|
+
/**
|
|
104
|
+
The total and partial scores for the detected document contour
|
|
105
|
+
*/
|
|
106
|
+
export declare class DetectionScores extends PartiallyConstructible {
|
|
107
|
+
/**
|
|
108
|
+
Weighted sum of all partial scores
|
|
109
|
+
*/
|
|
110
|
+
readonly totalScore: number;
|
|
111
|
+
/**
|
|
112
|
+
100 points, if the center of the contour is exactly in the image center
|
|
113
|
+
*/
|
|
114
|
+
readonly distanceScore: number;
|
|
115
|
+
/**
|
|
116
|
+
100 points, if all angles are 90 degrees
|
|
117
|
+
*/
|
|
118
|
+
readonly angleScore: number;
|
|
119
|
+
/**
|
|
120
|
+
100 points if the contour occupies at least 50% of the area of the image
|
|
121
|
+
*/
|
|
122
|
+
readonly sizeScore: number;
|
|
123
|
+
/**
|
|
124
|
+
100 points, if the aspect ratio matches exactly one of the given aspect ratios
|
|
125
|
+
*/
|
|
126
|
+
readonly aspectRatioScore: number;
|
|
127
|
+
/**
|
|
128
|
+
Percentage of the document contour that the edge detector was able to find (in LEGACY engine mode only)
|
|
129
|
+
*/
|
|
130
|
+
readonly lineCoverageScore: number;
|
|
131
|
+
/**
|
|
132
|
+
Percentage of the image width taken by the detected document
|
|
133
|
+
*/
|
|
134
|
+
readonly widthScore: number;
|
|
135
|
+
/**
|
|
136
|
+
Percentage of the image height taken by the detected document
|
|
137
|
+
*/
|
|
138
|
+
readonly heightScore: number;
|
|
139
|
+
/** @param source {@displayType `DeepPartial<DetectionScores>`} */
|
|
140
|
+
constructor(source?: DeepPartial<DetectionScores>);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
Result of the document contour detection
|
|
144
|
+
*/
|
|
145
|
+
export declare class DetectionResult extends PartiallyConstructible {
|
|
146
|
+
/**
|
|
147
|
+
Detection status
|
|
148
|
+
@defaultValue "NOT_ACQUIRED";
|
|
149
|
+
*/
|
|
150
|
+
readonly status: DetectionStatus;
|
|
151
|
+
/**
|
|
152
|
+
The total and partial scores for the detected quad
|
|
153
|
+
*/
|
|
154
|
+
readonly detectionScores: DetectionScores;
|
|
155
|
+
/**
|
|
156
|
+
Absolute coordinates of the detected document contour in image space
|
|
157
|
+
sorted in clockwise order, starting from the top left corner
|
|
158
|
+
*/
|
|
159
|
+
readonly points: Point[];
|
|
160
|
+
/**
|
|
161
|
+
All detected horizontal lines in image space
|
|
162
|
+
*/
|
|
163
|
+
readonly horizontalLines: LineSegmentInt[];
|
|
164
|
+
/**
|
|
165
|
+
All detected vertical lines in image space
|
|
166
|
+
*/
|
|
167
|
+
readonly verticalLines: LineSegmentInt[];
|
|
168
|
+
/**
|
|
169
|
+
Normalized coordinates of the detected document contour in image space
|
|
170
|
+
sorted in clockwise order, starting from the top left corner
|
|
171
|
+
*/
|
|
172
|
+
readonly pointsNormalized: Point[];
|
|
173
|
+
/**
|
|
174
|
+
Normalized horizontal lines in image space
|
|
175
|
+
*/
|
|
176
|
+
readonly horizontalLinesNormalized: LineSegmentFloat[];
|
|
177
|
+
/**
|
|
178
|
+
Normalized vertical lines in image space
|
|
179
|
+
*/
|
|
180
|
+
readonly verticalLinesNormalized: LineSegmentFloat[];
|
|
181
|
+
/**
|
|
182
|
+
Aspect ratio of the detected document contour
|
|
183
|
+
*/
|
|
184
|
+
readonly aspectRatio: number;
|
|
185
|
+
/**
|
|
186
|
+
Average brightness, calculated as the average
|
|
187
|
+
of the Value channel in the HSV color space of:
|
|
188
|
+
- the whole image, if no document was detected
|
|
189
|
+
- the document crop, if a document was detected
|
|
190
|
+
Ranges from 0 to 255
|
|
191
|
+
@defaultValue 0;
|
|
192
|
+
*/
|
|
193
|
+
readonly averageBrightness: number;
|
|
194
|
+
/** @param source {@displayType `DeepPartial<DetectionResult>`} */
|
|
195
|
+
constructor(source?: DeepPartial<DetectionResult>);
|
|
196
|
+
}
|