dynamsoft-barcode-reader-bundle 11.0.6000 → 11.2.2000-beta-202510290153
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/README.html +48 -41
- package/README.md +36 -32
- package/dist/dbr.bundle.d.ts +509 -101
- package/dist/dbr.bundle.esm.js +2 -2
- package/dist/dbr.bundle.js +2 -2
- package/dist/dbr.bundle.mjs +2 -2
- package/dist/dbr.bundle.worker.js +2 -2
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.js +1 -0
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.wasm +0 -0
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd-pthread.worker.js +6 -0
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd.js +1 -1
- package/dist/dynamsoft-barcode-reader-bundle-ml-simd.wasm +0 -0
- package/dist/dynamsoft-barcode-reader-bundle.js +1 -1
- package/dist/dynamsoft-barcode-reader-bundle.wasm +0 -0
- package/dist/models/Code128Decoder.data +0 -0
- package/dist/models/DataMatrixQRCodeLocalization.data +0 -0
- package/dist/models/EAN13Decoder.data +0 -0
- package/dist/models/OneDDeblur.data +0 -0
- package/dist/models/OneDLocalization.data +0 -0
- package/dist/templates/DBR-PresetTemplates.json +100 -165
- package/dist/ui/barcode-scanner.ui.xml +1 -0
- package/dist/ui/dls.license.dialog.html +1 -1
- package/package.json +10 -10
- package/samples.url +1 -1
- package/dist/dynamsoft-barcode-reader-bundle-ml.js +0 -1
- package/dist/dynamsoft-barcode-reader-bundle-ml.wasm +0 -0
package/dist/dbr.bundle.d.ts
CHANGED
|
@@ -532,9 +532,8 @@ interface PostMessageBody {
|
|
|
532
532
|
engineResourcePaths?: EngineResourcePaths;
|
|
533
533
|
autoResources?: WorkerAutoResources;
|
|
534
534
|
names?: string[];
|
|
535
|
+
wasmLoadOptions: WasmLoadOptions;
|
|
535
536
|
_bundleEnv?: "DCV" | "DBR";
|
|
536
|
-
_useSimd?: boolean;
|
|
537
|
-
_useMLBackend?: boolean;
|
|
538
537
|
}
|
|
539
538
|
type PathInfo = {
|
|
540
539
|
version: string;
|
|
@@ -586,6 +585,11 @@ interface WasmVersions {
|
|
|
586
585
|
interface MapController {
|
|
587
586
|
[key: string]: ((body: any, taskID: number, instanceID?: number) => void);
|
|
588
587
|
}
|
|
588
|
+
type WasmType = "baseline" | "ml" | "ml-simd" | "ml-simd-pthread" | "auto";
|
|
589
|
+
interface WasmLoadOptions {
|
|
590
|
+
wasmType?: WasmType;
|
|
591
|
+
pthreadPoolSize?: number;
|
|
592
|
+
}
|
|
589
593
|
type MimeType = "image/png" | "image/jpeg";
|
|
590
594
|
|
|
591
595
|
declare const mapAsyncDependency: {
|
|
@@ -621,9 +625,11 @@ declare class CoreModule {
|
|
|
621
625
|
static get _bDebug(): boolean;
|
|
622
626
|
static set _bDebug(value: boolean);
|
|
623
627
|
static _bundleEnv: "DCV" | "DBR";
|
|
624
|
-
static _useMLBackend: boolean;
|
|
625
628
|
static get _workerName(): string;
|
|
626
|
-
static
|
|
629
|
+
private static _wasmLoadOptions;
|
|
630
|
+
static get wasmLoadOptions(): WasmLoadOptions;
|
|
631
|
+
static set wasmLoadOptions(options: WasmLoadOptions);
|
|
632
|
+
static loadedWasmType: Exclude<WasmType, "auto">;
|
|
627
633
|
/**
|
|
628
634
|
* Initiates the loading process for the .wasm file(s) corresponding to the specified module(s).
|
|
629
635
|
* If a module relies on other modules, the other modules will be loaded as well.
|
|
@@ -632,6 +638,17 @@ declare class CoreModule {
|
|
|
632
638
|
*/
|
|
633
639
|
static isModuleLoaded(name?: string): boolean;
|
|
634
640
|
static loadWasm(): Promise<void>;
|
|
641
|
+
/**
|
|
642
|
+
* An event that fires during the loading of a WebAssembly module (.wasm).
|
|
643
|
+
*
|
|
644
|
+
* @param filePath The path of the wasm file.
|
|
645
|
+
* @param tag Indicates the ongoing status of the file download ("starting", "in progress", "completed").
|
|
646
|
+
* @param progress An object indicating the progress of the download, with `loaded` and `total` bytes.
|
|
647
|
+
*/
|
|
648
|
+
static onWasmLoadProgressChanged: (filePath: string, tag: "starting" | "in progress" | "completed", progress: {
|
|
649
|
+
loaded: number;
|
|
650
|
+
total: number;
|
|
651
|
+
}) => void;
|
|
635
652
|
/**
|
|
636
653
|
* Detect environment and get a report.
|
|
637
654
|
*/
|
|
@@ -683,7 +700,13 @@ interface CapturedResultItem {
|
|
|
683
700
|
|
|
684
701
|
interface OriginalImageResultItem extends CapturedResultItem {
|
|
685
702
|
/** The image data associated with this result item. */
|
|
686
|
-
|
|
703
|
+
imageData: DSImageData;
|
|
704
|
+
/** Converts the image data into an HTMLCanvasElement for display or further manipulation in web applications. */
|
|
705
|
+
toCanvas: () => HTMLCanvasElement;
|
|
706
|
+
/** Converts the image data into an HTMLImageElement of a specified MIME type ('image/png' or 'image/jpeg'). */
|
|
707
|
+
toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
|
|
708
|
+
/** Converts the image data into a Blob object of a specified MIME type ('image/png' or 'image/jpeg'). */
|
|
709
|
+
toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
|
|
687
710
|
}
|
|
688
711
|
|
|
689
712
|
interface Point {
|
|
@@ -1198,7 +1221,11 @@ declare const isQuad: (value: any) => value is Quadrilateral;
|
|
|
1198
1221
|
*/
|
|
1199
1222
|
declare const isRect: (value: any) => value is Rect;
|
|
1200
1223
|
|
|
1201
|
-
declare const requestResource: (url: string, type: "text" | "blob" | "arraybuffer"
|
|
1224
|
+
declare const requestResource: (url: string, type: "text" | "blob" | "arraybuffer", callbacks?: {
|
|
1225
|
+
loadstartCallback?: () => any;
|
|
1226
|
+
progressCallback?: (pe: any) => any;
|
|
1227
|
+
loadendCallback?: () => any;
|
|
1228
|
+
}) => Promise<any>;
|
|
1202
1229
|
declare const checkIsLink: (str: string) => boolean;
|
|
1203
1230
|
declare const compareVersion: (strV1: string, strV2: string) => number;
|
|
1204
1231
|
declare const handleEngineResourcePaths: (engineResourcePaths: EngineResourcePaths) => EngineResourcePaths;
|
|
@@ -1228,7 +1255,7 @@ declare const productNameMap: {
|
|
|
1228
1255
|
readonly dcvBundle: "dynamsoft-capture-vision-bundle";
|
|
1229
1256
|
};
|
|
1230
1257
|
|
|
1231
|
-
export { Arc, BinaryImageUnit, CapturedResultBase, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, CoreModule, Corner, DSFile, DSImageData, DSRect, DwtInfo, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumCrossVerificationStatus, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImageCaptureDistanceMode, EnumImageFileFormat, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumModuleName, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, EnumTransformMatrixType, ErrorInfo, FileImageTag, GrayscaleImageUnit, ImageSourceAdapter, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, MimeType, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, PathInfo, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, Quadrilateral, Rect, RegionObjectElement, ScaledColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZone, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmVersions, WorkerAutoResources, _getNorImageData, _saveToFile, _toBlob, _toCanvas, _toImage, bDebug, checkIsLink, compareVersion, doOrWaitAsyncDependency, getNextTaskID, handleEngineResourcePaths, innerVersions, isArc, isContour, isDSImageData, isDSRect, isImageTag, isLineSegment, isObject, isOriginalDsImageData, isPoint, isPolygon, isQuad, isRect, isSimdSupported, mapAsyncDependency, mapPackageRegister, mapTaskCallBack, onLog, productNameMap, requestResource, setBDebug, setOnLog, waitAsyncDependency, worker, workerAutoResources };
|
|
1258
|
+
export { Arc, BinaryImageUnit, CapturedResultBase, CapturedResultItem, ColourImageUnit, Contour, ContoursUnit, CoreModule, Corner, DSFile, DSImageData, DSRect, DwtInfo, Edge, EngineResourcePaths, EnhancedGrayscaleImageUnit, EnumBufferOverflowProtectionMode, EnumCapturedResultItemType, EnumColourChannelUsageType, EnumCornerType, EnumCrossVerificationStatus, EnumErrorCode, EnumGrayscaleEnhancementMode, EnumGrayscaleTransformationMode, EnumImageCaptureDistanceMode, EnumImageFileFormat, EnumImagePixelFormat, EnumImageTagType, EnumIntermediateResultUnitType, EnumModuleName, EnumPDFReadingMode, EnumRasterDataSource, EnumRegionObjectElementType, EnumSectionType, EnumTransformMatrixType, ErrorInfo, FileImageTag, GrayscaleImageUnit, ImageSourceAdapter, ImageSourceErrorListener, ImageTag, InnerVersions, IntermediateResult, IntermediateResultExtraInfo, IntermediateResultUnit, LineSegment, LineSegmentsUnit, MapController, MimeType, ObservationParameters, OriginalImageResultItem, PDFReadingParameter, PathInfo, Point, Polygon, PostMessageBody, PredetectedRegionElement, PredetectedRegionsUnit, Quadrilateral, Rect, RegionObjectElement, ScaledColourImageUnit, ShortLinesUnit, TextRemovedBinaryImageUnit, TextZone, TextZonesUnit, TextureDetectionResultUnit, TextureRemovedBinaryImageUnit, TextureRemovedGrayscaleImageUnit, TransformedGrayscaleImageUnit, Warning, WasmLoadOptions, WasmType, WasmVersions, WorkerAutoResources, _getNorImageData, _saveToFile, _toBlob, _toCanvas, _toImage, bDebug, checkIsLink, compareVersion, doOrWaitAsyncDependency, getNextTaskID, handleEngineResourcePaths, innerVersions, isArc, isContour, isDSImageData, isDSRect, isImageTag, isLineSegment, isObject, isOriginalDsImageData, isPoint, isPolygon, isQuad, isRect, isSimdSupported, mapAsyncDependency, mapPackageRegister, mapTaskCallBack, onLog, productNameMap, requestResource, setBDebug, setOnLog, waitAsyncDependency, worker, workerAutoResources };
|
|
1232
1259
|
|
|
1233
1260
|
|
|
1234
1261
|
|
|
@@ -1241,9 +1268,9 @@ interface CapturedResult extends CapturedResultBase {
|
|
|
1241
1268
|
/** The decoded barcode results within the original image. */
|
|
1242
1269
|
decodedBarcodesResult?: DecodedBarcodesResult;
|
|
1243
1270
|
/** The recognized textLine results within the original image. */
|
|
1244
|
-
|
|
1271
|
+
recognizedTextLinesResult?: RecognizedTextLinesResult;
|
|
1245
1272
|
/** The processed document results within the original image. */
|
|
1246
|
-
|
|
1273
|
+
processedDocumentResult?: ProcessedDocumentResult;
|
|
1247
1274
|
/** The parsed results within the original image. */
|
|
1248
1275
|
parsedResult?: ParsedResult;
|
|
1249
1276
|
}
|
|
@@ -1261,7 +1288,10 @@ declare class CapturedResultReceiver {
|
|
|
1261
1288
|
* @param result The original image result, an instance of `OriginalImageResultItem`.
|
|
1262
1289
|
*/
|
|
1263
1290
|
onOriginalImageResultReceived?: (result: OriginalImageResultItem) => void;
|
|
1264
|
-
|
|
1291
|
+
onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
|
|
1292
|
+
onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void;
|
|
1293
|
+
onProcessedDocumentResultReceived?: (result: ProcessedDocumentResult) => void;
|
|
1294
|
+
onParsedResultsReceived?: (result: ParsedResult) => void;
|
|
1265
1295
|
}
|
|
1266
1296
|
|
|
1267
1297
|
declare class BufferedItemsManager {
|
|
@@ -1281,7 +1311,7 @@ declare class BufferedItemsManager {
|
|
|
1281
1311
|
* Gets the buffered character items.
|
|
1282
1312
|
* @return the buffered character items
|
|
1283
1313
|
*/
|
|
1284
|
-
getBufferedCharacterItemSet(): Promise<Array<
|
|
1314
|
+
getBufferedCharacterItemSet(): Promise<Array<BufferedCharacterItemSet>>;
|
|
1285
1315
|
}
|
|
1286
1316
|
|
|
1287
1317
|
declare class IntermediateResultReceiver {
|
|
@@ -1310,6 +1340,22 @@ declare class IntermediateResultReceiver {
|
|
|
1310
1340
|
onTextZonesUnitReceived?: (result: TextZonesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1311
1341
|
onTextRemovedBinaryImageUnitReceived?: (result: TextRemovedBinaryImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1312
1342
|
onShortLinesUnitReceived?: (result: ShortLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1343
|
+
onCandidateBarcodeZonesUnitReceived?: (result: CandidateBarcodeZonesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1344
|
+
onComplementedBarcodeImageUnitReceived?: (result: ComplementedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1345
|
+
onDecodedBarcodesReceived?: (result: DecodedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1346
|
+
onDeformationResistedBarcodeImageUnitReceived?: (result: DeformationResistedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1347
|
+
onLocalizedBarcodesReceived?: (result: LocalizedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1348
|
+
onScaledBarcodeImageUnitReceived?: (result: ScaledBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1349
|
+
onLocalizedTextLinesReceived?: (result: LocalizedTextLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1350
|
+
onRawTextLinesUnitReceived?: (result: RawTextLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1351
|
+
onRecognizedTextLinesReceived?: (result: RecognizedTextLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1352
|
+
onCandidateQuadEdgesUnitReceived?: (result: CandidateQuadEdgesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1353
|
+
onCornersUnitReceived?: (result: CornersUnit, info: IntermediateResultExtraInfo) => void;
|
|
1354
|
+
onDeskewedImageReceived?: (result: DeskewedImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1355
|
+
onDetectedQuadsReceived?: (result: DetectedQuadsUnit, info: IntermediateResultExtraInfo) => void;
|
|
1356
|
+
onEnhancedImageReceived?: (result: EnhancedImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
1357
|
+
onLogicLinesUnitReceived?: (result: LogicLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1358
|
+
onLongLinesUnitReceived?: (result: LongLinesUnit, info: IntermediateResultExtraInfo) => void;
|
|
1313
1359
|
}
|
|
1314
1360
|
|
|
1315
1361
|
declare class IntermediateResultManager {
|
|
@@ -1383,21 +1429,44 @@ interface SimplifiedCaptureVisionSettings {
|
|
|
1383
1429
|
* Specifies the basic settings for the barcode reader module. It is of type `SimplifiedBarcodeReaderSettings`.
|
|
1384
1430
|
*/
|
|
1385
1431
|
barcodeSettings: SimplifiedBarcodeReaderSettings;
|
|
1432
|
+
/**
|
|
1433
|
+
* Specifies the basic settings for the document normalizer module. It is of type `SimplifiedDocumentNormalizerSettings`.
|
|
1434
|
+
*/
|
|
1435
|
+
documentSettings: SimplifiedDocumentNormalizerSettings;
|
|
1436
|
+
/**
|
|
1437
|
+
* Specifies the basic settings for the label recognizer module. It is of type `SimplifiedLabelRecognizerSettings`.
|
|
1438
|
+
*/
|
|
1439
|
+
labelSettings: SimplifiedLabelRecognizerSettings;
|
|
1386
1440
|
}
|
|
1387
1441
|
|
|
1388
1442
|
interface CapturedResultFilter {
|
|
1389
1443
|
onOriginalImageResultReceived?: (result: OriginalImageResultItem) => void;
|
|
1390
|
-
|
|
1444
|
+
onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
|
|
1445
|
+
onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void;
|
|
1446
|
+
onProcessedDocumentResultReceived?: (result: ProcessedDocumentResult) => void;
|
|
1447
|
+
onParsedResultsReceived?: (result: ParsedResult) => void;
|
|
1448
|
+
getFilteredResultItemTypes(): number;
|
|
1391
1449
|
}
|
|
1392
1450
|
|
|
1393
1451
|
declare class CaptureVisionRouter {
|
|
1394
1452
|
#private;
|
|
1395
1453
|
static _onLog: (message: string) => void;
|
|
1396
1454
|
static _defaultTemplate: string;
|
|
1455
|
+
private static _isNoOnnx;
|
|
1397
1456
|
/**
|
|
1398
1457
|
* The maximum length of the longer side of the image to be processed. The default value is 2048 pixels in mobile devices and 4096 pixels in desktop browser.
|
|
1399
1458
|
*/
|
|
1400
1459
|
maxImageSideLength: number;
|
|
1460
|
+
/**
|
|
1461
|
+
* An event that fires during the loading of a recognition data file (.data).
|
|
1462
|
+
* @param filePath The path of the recognition data file.
|
|
1463
|
+
* @param tag Indicates the ongoing status of the file download ("starting", "in progress", "completed").
|
|
1464
|
+
* @param progress An object indicating the progress of the download, with `loaded` and `total` bytes.
|
|
1465
|
+
*/
|
|
1466
|
+
static onDataLoadProgressChanged: (filePath: string, tag: "starting" | "in progress" | "completed", progress: {
|
|
1467
|
+
loaded: number;
|
|
1468
|
+
total: number;
|
|
1469
|
+
}) => void;
|
|
1401
1470
|
/**
|
|
1402
1471
|
* An event that fires when an error occurs from the start of capturing process.
|
|
1403
1472
|
* @param error The error object that contains the error code and error string.
|
|
@@ -1432,23 +1501,17 @@ declare class CaptureVisionRouter {
|
|
|
1432
1501
|
*/
|
|
1433
1502
|
static createInstance(loadPresetTemplates?: boolean): Promise<CaptureVisionRouter>;
|
|
1434
1503
|
/**
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
static
|
|
1504
|
+
* Appends a deep learning model to the memory buffer.
|
|
1505
|
+
* @param dataName Specifies the name of the model.
|
|
1506
|
+
* @param dataPath [Optional] Specifies the path to find the model file. If not specified, the default path points to the package "dynamsoft-capture-vision-data".
|
|
1507
|
+
*
|
|
1508
|
+
* @returns A promise that resolves once the model file is successfully loaded. It does not provide any value upon resolution.
|
|
1509
|
+
*/
|
|
1510
|
+
static appendDLModelBuffer(modelName: string, dataPath?: string): Promise<ErrorInfo>;
|
|
1442
1511
|
/**
|
|
1443
|
-
*
|
|
1444
|
-
* @param filePath The path of the recognition data file.
|
|
1445
|
-
* @param tag Indicates the ongoing status of the file download ("starting", "in progress", "completed").
|
|
1446
|
-
* @param progress An object indicating the progress of the download, with `loaded` and `total` bytes.
|
|
1512
|
+
* Clears all deep learning models from buffer to free up memory
|
|
1447
1513
|
*/
|
|
1448
|
-
static
|
|
1449
|
-
loaded: number;
|
|
1450
|
-
total: number;
|
|
1451
|
-
}) => void;
|
|
1514
|
+
static clearDLModelBuffers(): Promise<void>;
|
|
1452
1515
|
private _singleFrameModeCallback;
|
|
1453
1516
|
private _singleFrameModeCallbackBind;
|
|
1454
1517
|
/**
|
|
@@ -1506,11 +1569,21 @@ declare class CaptureVisionRouter {
|
|
|
1506
1569
|
*/
|
|
1507
1570
|
stopCapturing(): void;
|
|
1508
1571
|
containsTask(templateName: string): Promise<any>;
|
|
1572
|
+
/**
|
|
1573
|
+
* Switches the currently active capturing template during the image processing workflow. This allows dynamic reconfiguration of the capture process without restarting or reinitializing the system, enabling different settings or rules to be applied on the fly.
|
|
1574
|
+
*
|
|
1575
|
+
* @param templateName The name of the new capturing template to apply.
|
|
1576
|
+
*
|
|
1577
|
+
* @return A promise with an ErrorInfo object that resolves when the operation has completed, containing the result of the operation.
|
|
1578
|
+
*
|
|
1579
|
+
*/
|
|
1580
|
+
switchCapturingTemplate(templateName: string): Promise<void>;
|
|
1509
1581
|
/**
|
|
1510
1582
|
* Video stream capture, recursive call, loop frame capture
|
|
1511
1583
|
*/
|
|
1512
1584
|
private _loopReadVideo;
|
|
1513
1585
|
private _reRunCurrnetFunc;
|
|
1586
|
+
getClarity(dsimage: DSImageData, bitcount: number, wr: number, hr: number, grayThreshold: number): Promise<number>;
|
|
1514
1587
|
/**
|
|
1515
1588
|
* Processes a single image or a file containing a single image to derive important information.
|
|
1516
1589
|
* @param imageOrFile Specifies the image or file to be processed. The following data types are accepted: `Blob`, `HTMLImageElement`, `HTMLCanvasElement`, `HTMLVideoElement`, `DSImageData`, `string`.
|
|
@@ -1588,6 +1661,11 @@ declare class CaptureVisionRouter {
|
|
|
1588
1661
|
* @returns The `IntermediateResultManager` object.
|
|
1589
1662
|
*/
|
|
1590
1663
|
getIntermediateResultManager(): IntermediateResultManager;
|
|
1664
|
+
/**
|
|
1665
|
+
* Sets the global number of threads used internally for model execution.
|
|
1666
|
+
* @param intraOpNumThreads Number of threads used internally for model execution.
|
|
1667
|
+
*/
|
|
1668
|
+
static setGlobalIntraOpNumThreads(intraOpNumThreads?: number): Promise<void>;
|
|
1591
1669
|
parseRequiredResources(templateName: string): Promise<{
|
|
1592
1670
|
models: string[];
|
|
1593
1671
|
specss: string[];
|
|
@@ -1865,6 +1943,8 @@ declare enum EnumLocalizationMode {
|
|
|
1865
1943
|
LM_CENTRE = 128,
|
|
1866
1944
|
/** Specialized for quick localization of 1D barcodes, enhancing performance in fast-scan scenarios. */
|
|
1867
1945
|
LM_ONED_FAST_SCAN = 256,
|
|
1946
|
+
/**Localizes barcodes by utilizing a neural network model. */
|
|
1947
|
+
LM_NEURAL_NETWORK = 512,
|
|
1868
1948
|
/** Reserved for future use in localization mode settings. */
|
|
1869
1949
|
LM_REV = -2147483648,
|
|
1870
1950
|
/** Omits the localization process entirely. */
|
|
@@ -1959,15 +2039,7 @@ interface DecodedBarcodesResult extends CapturedResultBase {
|
|
|
1959
2039
|
/**
|
|
1960
2040
|
* An array of `BarcodeResultItem` objects, each representing a decoded barcode within the original image.
|
|
1961
2041
|
*/
|
|
1962
|
-
|
|
1963
|
-
}
|
|
1964
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
1965
|
-
interface CapturedResultReceiver {
|
|
1966
|
-
onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
|
|
1967
|
-
}
|
|
1968
|
-
interface CapturedResultFilter {
|
|
1969
|
-
onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
|
|
1970
|
-
}
|
|
2042
|
+
barcodeResultItems: Array<BarcodeResultItem>;
|
|
1971
2043
|
}
|
|
1972
2044
|
|
|
1973
2045
|
interface DecodedBarcodeElement extends RegionObjectElement {
|
|
@@ -2100,30 +2172,15 @@ interface CandidateBarcodeZone {
|
|
|
2100
2172
|
interface CandidateBarcodeZonesUnit extends IntermediateResultUnit {
|
|
2101
2173
|
/** Array of candidate barcode zones represented as quadrilaterals. */
|
|
2102
2174
|
candidateBarcodeZones: Array<CandidateBarcodeZone>;
|
|
2103
|
-
}
|
|
2104
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2105
|
-
interface IntermediateResultReceiver {
|
|
2106
|
-
onCandidateBarcodeZonesUnitReceived?: (result: CandidateBarcodeZonesUnit, info: IntermediateResultExtraInfo) => void;
|
|
2107
|
-
}
|
|
2108
2175
|
}
|
|
2109
2176
|
|
|
2110
2177
|
interface ComplementedBarcodeImageUnit extends IntermediateResultUnit {
|
|
2111
2178
|
imageData: DSImageData;
|
|
2112
2179
|
location: Quadrilateral;
|
|
2113
|
-
}
|
|
2114
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2115
|
-
interface IntermediateResultReceiver {
|
|
2116
|
-
onComplementedBarcodeImageUnitReceived?: (result: ComplementedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
2117
|
-
}
|
|
2118
2180
|
}
|
|
2119
2181
|
|
|
2120
2182
|
interface DecodedBarcodesUnit extends IntermediateResultUnit {
|
|
2121
2183
|
decodedBarcodes: Array<DecodedBarcodeElement>;
|
|
2122
|
-
}
|
|
2123
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2124
|
-
interface IntermediateResultReceiver {
|
|
2125
|
-
onDecodedBarcodesReceived?: (result: DecodedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
|
|
2126
|
-
}
|
|
2127
2184
|
}
|
|
2128
2185
|
|
|
2129
2186
|
/**
|
|
@@ -2144,11 +2201,6 @@ interface DeformationResistedBarcode {
|
|
|
2144
2201
|
interface DeformationResistedBarcodeImageUnit extends IntermediateResultUnit {
|
|
2145
2202
|
/** The deformation-resisted barcode. */
|
|
2146
2203
|
deformationResistedBarcode: DeformationResistedBarcode;
|
|
2147
|
-
}
|
|
2148
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2149
|
-
interface IntermediateResultReceiver {
|
|
2150
|
-
onDeformationResistedBarcodeImageUnitReceived?: (result: DeformationResistedBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
2151
|
-
}
|
|
2152
2204
|
}
|
|
2153
2205
|
|
|
2154
2206
|
interface LocalizedBarcodeElement extends RegionObjectElement {
|
|
@@ -2167,21 +2219,11 @@ interface LocalizedBarcodeElement extends RegionObjectElement {
|
|
|
2167
2219
|
interface LocalizedBarcodesUnit extends IntermediateResultUnit {
|
|
2168
2220
|
/** An array of `LocalizedBarcodeElement` objects, each representing a localized barcode. */
|
|
2169
2221
|
localizedBarcodes: Array<LocalizedBarcodeElement>;
|
|
2170
|
-
}
|
|
2171
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2172
|
-
interface IntermediateResultReceiver {
|
|
2173
|
-
onLocalizedBarcodesReceived?: (result: LocalizedBarcodesUnit, info: IntermediateResultExtraInfo) => void;
|
|
2174
|
-
}
|
|
2175
2222
|
}
|
|
2176
2223
|
|
|
2177
2224
|
interface ScaledBarcodeImageUnit extends IntermediateResultUnit {
|
|
2178
2225
|
/** Image data of the scaled barcode. */
|
|
2179
2226
|
imageData: DSImageData;
|
|
2180
|
-
}
|
|
2181
|
-
declare module "dynamsoft-barcode-reader-bundle" {
|
|
2182
|
-
interface IntermediateResultReceiver {
|
|
2183
|
-
onScaledBarcodeImageUnitReceived?: (result: ScaledBarcodeImageUnit, info: IntermediateResultExtraInfo) => void;
|
|
2184
|
-
}
|
|
2185
2227
|
}
|
|
2186
2228
|
|
|
2187
2229
|
export { BarcodeReaderModule, EnumBarcodeFormat, EnumDeblurMode, EnumExtendedBarcodeResultType, EnumLocalizationMode, EnumQRCodeErrorCorrectionLevel };
|
|
@@ -3313,6 +3355,7 @@ declare class CameraManager {
|
|
|
3313
3355
|
version: number;
|
|
3314
3356
|
OS: string;
|
|
3315
3357
|
};
|
|
3358
|
+
private static _tryToReopenTime;
|
|
3316
3359
|
static onWarning: (message: string) => void;
|
|
3317
3360
|
/**
|
|
3318
3361
|
* Check if storage is available.
|
|
@@ -4161,6 +4204,17 @@ declare class CameraEnhancer extends ImageSourceAdapter {
|
|
|
4161
4204
|
* @returns A `Point` object representing the converted x and y coordinates relative to the viewport.
|
|
4162
4205
|
*/
|
|
4163
4206
|
convertToScanRegionCoordinates(point: Point): Point;
|
|
4207
|
+
/**
|
|
4208
|
+
* Converts coordinates from the video's coordinate system under `fit: cover` mode
|
|
4209
|
+
* back to coordinates under `fit: contain` mode.
|
|
4210
|
+
* This is useful when you need to map points detected in a cropped/resized video (cover)
|
|
4211
|
+
* back to the original video dimensions (contain).
|
|
4212
|
+
*
|
|
4213
|
+
* @param point A `Point` object representing the x and y coordinates within the video's `cover` coordinate system.
|
|
4214
|
+
*
|
|
4215
|
+
* @returns A `Point` object representing the converted x and y coordinates under `contain` mode.
|
|
4216
|
+
*/
|
|
4217
|
+
convertToContainCoordinates(point: Point): Point;
|
|
4164
4218
|
/**
|
|
4165
4219
|
* Releases all resources used by the `CameraEnhancer` instance.
|
|
4166
4220
|
*/
|
|
@@ -4717,6 +4771,16 @@ declare class CodeParserModule {
|
|
|
4717
4771
|
* @returns A promise that resolves when the specification is loaded. It does not provide any value upon resolution.
|
|
4718
4772
|
*/
|
|
4719
4773
|
static loadSpec(specificationName: string | Array<string>, specificationPath?: string): Promise<void>;
|
|
4774
|
+
/**
|
|
4775
|
+
* An event that repeatedly fires during the loading of specification files.
|
|
4776
|
+
* @param filePath Returns the path of the specification file.
|
|
4777
|
+
* @param tag Indicates the ongoing status of the file download. Available values are "starting", "in progress", "completed".
|
|
4778
|
+
* @param progress Shows the numerical progress of the download.
|
|
4779
|
+
*/
|
|
4780
|
+
static onSpecLoadProgressChanged: (filePath: string, tag: "starting" | "in progress" | "completed", progress: {
|
|
4781
|
+
loaded: number;
|
|
4782
|
+
total: number;
|
|
4783
|
+
}) => void;
|
|
4720
4784
|
}
|
|
4721
4785
|
|
|
4722
4786
|
declare enum EnumMappingStatus {
|
|
@@ -4754,15 +4818,362 @@ interface ParsedResult extends CapturedResultBase {
|
|
|
4754
4818
|
* An array of `ParsedResultItem` objects.
|
|
4755
4819
|
*/
|
|
4756
4820
|
parsedResultItems: Array<ParsedResultItem>;
|
|
4757
|
-
}
|
|
4758
|
-
declare module "dynamsoft-capture-vision-bundle" {
|
|
4759
|
-
interface CapturedResultReceiver {
|
|
4760
|
-
onParsedResultsReceived?: (result: ParsedResult) => void;
|
|
4761
|
-
}
|
|
4762
4821
|
}
|
|
4763
4822
|
|
|
4764
4823
|
export { CodeParser, CodeParserModule, EnumMappingStatus, EnumValidationStatus, ParsedResult, ParsedResultItem };
|
|
4765
4824
|
|
|
4825
|
+
|
|
4826
|
+
declare class DocumentNormalizerModule {
|
|
4827
|
+
/**
|
|
4828
|
+
* Returns the version of the DocumentNormalizer module.
|
|
4829
|
+
*/
|
|
4830
|
+
static getVersion(): string;
|
|
4831
|
+
}
|
|
4832
|
+
|
|
4833
|
+
/**
|
|
4834
|
+
* `EnumImageColourMode` determines the output colour mode of the normalized image.
|
|
4835
|
+
*/
|
|
4836
|
+
declare enum EnumImageColourMode {
|
|
4837
|
+
/** Output image in color mode. */
|
|
4838
|
+
ICM_COLOUR = 0,
|
|
4839
|
+
/** Output image in grayscale mode. */
|
|
4840
|
+
ICM_GRAYSCALE = 1,
|
|
4841
|
+
/** Output image in binary mode. */
|
|
4842
|
+
ICM_BINARY = 2
|
|
4843
|
+
}
|
|
4844
|
+
|
|
4845
|
+
interface DetectedQuadResultItem extends CapturedResultItem {
|
|
4846
|
+
/** The location of the detected quadrilateral within the original image, represented as a quadrilateral shape. */
|
|
4847
|
+
location: Quadrilateral;
|
|
4848
|
+
/** A confidence score related to the detected quadrilateral's accuracy as a document boundary. */
|
|
4849
|
+
confidenceAsDocumentBoundary: number;
|
|
4850
|
+
/** Indicates whether the DetectedQuadResultItem has passed corss verification. */
|
|
4851
|
+
CrossVerificationStatus: EnumCrossVerificationStatus;
|
|
4852
|
+
}
|
|
4853
|
+
|
|
4854
|
+
interface DeskewedImageResultItem extends CapturedResultItem {
|
|
4855
|
+
/** The image data for the deskewed image result. */
|
|
4856
|
+
imageData: DSImageData;
|
|
4857
|
+
/** The location where the deskewed image was extracted from within the input image image of the deskew section, represented as a quadrilateral. */
|
|
4858
|
+
sourceLocation: Quadrilateral;
|
|
4859
|
+
toCanvas: () => HTMLCanvasElement;
|
|
4860
|
+
toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
|
|
4861
|
+
toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
|
|
4862
|
+
}
|
|
4863
|
+
|
|
4864
|
+
interface EnhancedImageElement extends RegionObjectElement {
|
|
4865
|
+
/** The image data for the enhanced image. */
|
|
4866
|
+
imageData: DSImageData;
|
|
4867
|
+
}
|
|
4868
|
+
|
|
4869
|
+
interface EnhancedImageResultItem extends CapturedResultItem {
|
|
4870
|
+
/** The image data for the enhanced image result. */
|
|
4871
|
+
imageData: DSImageData;
|
|
4872
|
+
/** Converts the enhanced image data into an HTMLCanvasElement for display or further manipulation in web applications. */
|
|
4873
|
+
toCanvas: () => HTMLCanvasElement;
|
|
4874
|
+
/** Converts the enhanced image data into an HTMLImageElement of a specified MIME type ('image/png' or 'image/jpeg'). */
|
|
4875
|
+
toImage: (MIMEType: "image/png" | "image/jpeg") => HTMLImageElement;
|
|
4876
|
+
/** Converts the enhanced image data into a Blob object of a specified MIME type ('image/png' or 'image/jpeg'). */
|
|
4877
|
+
toBlob: (MIMEType: "image/png" | "image/jpeg") => Promise<Blob>;
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4880
|
+
interface EnhancedImageUnit extends IntermediateResultUnit {
|
|
4881
|
+
/** An array of `EnhancedImageElement` objects, each representing a piece of the original image after enhancement. */
|
|
4882
|
+
enhancedImage: EnhancedImageElement;
|
|
4883
|
+
}
|
|
4884
|
+
|
|
4885
|
+
interface CandidateQuadEdgesUnit extends IntermediateResultUnit {
|
|
4886
|
+
/** An array of candidate edges that may form quadrilaterals, identified during image processing. */
|
|
4887
|
+
candidateQuadEdges: Array<Edge>;
|
|
4888
|
+
}
|
|
4889
|
+
|
|
4890
|
+
interface CornersUnit extends IntermediateResultUnit {
|
|
4891
|
+
/** An array of detected corners within the image, identified during image processing. */
|
|
4892
|
+
corners: Array<Corner>;
|
|
4893
|
+
}
|
|
4894
|
+
|
|
4895
|
+
interface DetectedQuadElement extends RegionObjectElement {
|
|
4896
|
+
/** A confidence score measuring the certainty that the detected quadrilateral represents the boundary of a document. */
|
|
4897
|
+
confidenceAsDocumentBoundary: number;
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4900
|
+
interface DetectedQuadsUnit extends IntermediateResultUnit {
|
|
4901
|
+
/** An array of `DetectedQuadElement` objects, each representing a potential document or area of interest within the image. */
|
|
4902
|
+
detectedQuads: Array<DetectedQuadElement>;
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
interface LongLinesUnit extends IntermediateResultUnit {
|
|
4906
|
+
/** An array of long line segments detected within the image. */
|
|
4907
|
+
longLines: Array<LineSegment>;
|
|
4908
|
+
}
|
|
4909
|
+
|
|
4910
|
+
interface LogicLinesUnit extends IntermediateResultUnit {
|
|
4911
|
+
/** An array of logic line segments detected within the image. */
|
|
4912
|
+
logicLines: Array<LineSegment>;
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4915
|
+
interface DeskewedImageElement extends RegionObjectElement {
|
|
4916
|
+
/** The image data for the deskewed image. */
|
|
4917
|
+
imageData: DSImageData;
|
|
4918
|
+
/** A reference to another `RegionObjectElement`. */
|
|
4919
|
+
referencedElement: RegionObjectElement;
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4922
|
+
interface DeskewedImageUnit extends IntermediateResultUnit {
|
|
4923
|
+
/** The `DeskewedImageElement` objects representing a piece of the original image after deskewing. */
|
|
4924
|
+
deskewedImage: DeskewedImageElement;
|
|
4925
|
+
}
|
|
4926
|
+
|
|
4927
|
+
interface ProcessedDocumentResult extends CapturedResultBase {
|
|
4928
|
+
/** An array of `DetectedQuadResultItem` objects, each representing a quadrilateral after document detection. */
|
|
4929
|
+
detectedQuadResultItems: Array<DetectedQuadResultItem>;
|
|
4930
|
+
/** An array of `DeskewedImageResultItem` objects, each representing a piece of the original image after deskewing. */
|
|
4931
|
+
deskewedImageResultItems: Array<DeskewedImageResultItem>;
|
|
4932
|
+
/** An array of `EnhancedImageResultItem` objects, each representing a piece of the original image after enhancement. */
|
|
4933
|
+
enhancedImageResultItems: Array<EnhancedImageResultItem>;
|
|
4934
|
+
}
|
|
4935
|
+
|
|
4936
|
+
/**
|
|
4937
|
+
* The `SimplifiedDocumentNormalizerSettings` interface defines simplified settings for document detection and normalization.
|
|
4938
|
+
*/
|
|
4939
|
+
interface SimplifiedDocumentNormalizerSettings {
|
|
4940
|
+
/** Grayscale enhancement modes to apply for improving detection in challenging conditions. */
|
|
4941
|
+
grayscaleEnhancementModes: Array<EnumGrayscaleEnhancementMode>;
|
|
4942
|
+
/** Grayscale transformation modes to apply, enhancing detection capability. */
|
|
4943
|
+
grayscaleTransformationModes: Array<EnumGrayscaleTransformationMode>;
|
|
4944
|
+
/** Color mode of the anticipated normalized page */
|
|
4945
|
+
colourMode: EnumImageColourMode;
|
|
4946
|
+
/** Width and height of the anticipated normalized page. */
|
|
4947
|
+
pageSize: [number, number];
|
|
4948
|
+
/** Anticipated brightness level of the normalized image. */
|
|
4949
|
+
brightness: number;
|
|
4950
|
+
/** Anticipated contrast level of the normalized image. */
|
|
4951
|
+
contrast: number;
|
|
4952
|
+
/**
|
|
4953
|
+
* Threshold for reducing the size of large images to speed up processing.
|
|
4954
|
+
* If the size of the image's shorter edge exceeds this threshold, the image may be downscaled to decrease processing time. The standard setting is 2300.
|
|
4955
|
+
*/
|
|
4956
|
+
scaleDownThreshold: number;
|
|
4957
|
+
/** The minimum ratio between the target document area and the total image area. Only those exceedingthis value will be output (measured in percentages).*/
|
|
4958
|
+
minQuadrilateralAreaRatio: number;
|
|
4959
|
+
/** The number of documents expected to be detected.*/
|
|
4960
|
+
expectedDocumentsCount: number;
|
|
4961
|
+
}
|
|
4962
|
+
|
|
4963
|
+
export { CandidateQuadEdgesUnit, CornersUnit, DeskewedImageElement, DeskewedImageResultItem, DeskewedImageUnit, DetectedQuadElement, DetectedQuadResultItem, DetectedQuadsUnit, DocumentNormalizerModule, EnhancedImageElement, EnhancedImageResultItem, EnhancedImageUnit, EnumImageColourMode, LogicLinesUnit, LongLinesUnit, ProcessedDocumentResult, SimplifiedDocumentNormalizerSettings };
|
|
4964
|
+
|
|
4965
|
+
|
|
4966
|
+
declare class LabelRecognizerModule {
|
|
4967
|
+
#private;
|
|
4968
|
+
/**
|
|
4969
|
+
* An event that repeatedly fires during the loading of a recognition data file (.data).
|
|
4970
|
+
* @param filePath Returns the path of the recognition data file.
|
|
4971
|
+
* @param tag Indicates the ongoing status of the file download. Available values are "starting", "in progress", "completed".
|
|
4972
|
+
* @param progress Shows the numerical progress of the download.
|
|
4973
|
+
*/
|
|
4974
|
+
static onDataLoadProgressChanged: (filePath: string, tag: "starting" | "in progress" | "completed", progress: {
|
|
4975
|
+
loaded: number;
|
|
4976
|
+
total: number;
|
|
4977
|
+
}) => void;
|
|
4978
|
+
/**
|
|
4979
|
+
* Returns the version of the LabelRecognizer module.
|
|
4980
|
+
*/
|
|
4981
|
+
static getVersion(): string;
|
|
4982
|
+
/**
|
|
4983
|
+
* Loads a specific data file containing confusable characters information.
|
|
4984
|
+
* @param dataName The name of the recognition data to load.
|
|
4985
|
+
* @param dataPath specifies the path to find the data file. If not specified, the default path points to the package “dynamsoft-capture-vision-data”.
|
|
4986
|
+
*/
|
|
4987
|
+
static loadConfusableCharsData(dataName: string, dataPath?: string): Promise<ErrorInfo>;
|
|
4988
|
+
/**
|
|
4989
|
+
* Loads a specific data file containing overlapping characters information.
|
|
4990
|
+
* @param dataName The name of the recognition data to load.
|
|
4991
|
+
* @param dataPath specifies the path to find the data file. If not specified, the default path points to the package “dynamsoft-capture-vision-data”.
|
|
4992
|
+
*/
|
|
4993
|
+
static loadOverlappingCharsData(dataName: string, dataPath?: string): Promise<ErrorInfo>;
|
|
4994
|
+
}
|
|
4995
|
+
|
|
4996
|
+
interface CharacterResult {
|
|
4997
|
+
/** The highest confidence character recognized. */
|
|
4998
|
+
characterH: string;
|
|
4999
|
+
/** The medium confidence character recognized. */
|
|
5000
|
+
characterM: string;
|
|
5001
|
+
/** The lowest confidence character recognized. */
|
|
5002
|
+
characterL: string;
|
|
5003
|
+
/** Confidence score for the highest confidence character. */
|
|
5004
|
+
characterHConfidence: number;
|
|
5005
|
+
/** Confidence score for the medium confidence character. */
|
|
5006
|
+
characterMConfidence: number;
|
|
5007
|
+
/** Confidence score for the lowest confidence character. */
|
|
5008
|
+
characterLConfidence: number;
|
|
5009
|
+
/** The location of the recognized character within the image. */
|
|
5010
|
+
location: Quadrilateral;
|
|
5011
|
+
}
|
|
5012
|
+
|
|
5013
|
+
interface TextLineResultItem extends CapturedResultItem {
|
|
5014
|
+
/** The recognized text of the line. */
|
|
5015
|
+
text: string;
|
|
5016
|
+
/** The location of the text line within the image. */
|
|
5017
|
+
location: Quadrilateral;
|
|
5018
|
+
/** Confidence score for the recognized text line. */
|
|
5019
|
+
confidence: number;
|
|
5020
|
+
/** Results for individual characters within the text line. */
|
|
5021
|
+
characterResults: Array<CharacterResult>;
|
|
5022
|
+
/** The name of the TextLineSpecification object that generated this TextLineResultItem. */
|
|
5023
|
+
specificationName: string;
|
|
5024
|
+
/** The recognized raw text of the line. */
|
|
5025
|
+
rawText: string;
|
|
5026
|
+
}
|
|
5027
|
+
|
|
5028
|
+
declare function filterVINResult(vinItem: TextLineResultItem): string;
|
|
5029
|
+
/**
|
|
5030
|
+
* check if the vin code is valid
|
|
5031
|
+
* @ignore
|
|
5032
|
+
*/
|
|
5033
|
+
declare function checkValidVIN(code: string): boolean;
|
|
5034
|
+
/**
|
|
5035
|
+
* check if the second row of passport mrz code is valid.
|
|
5036
|
+
* check digit only exits in second row in passport mrz.
|
|
5037
|
+
* @ignore
|
|
5038
|
+
*/
|
|
5039
|
+
declare function checkValidMRP(code: string): boolean;
|
|
5040
|
+
/**
|
|
5041
|
+
* check if the second row of visa mrz code is valid.
|
|
5042
|
+
* check digit only exits in second row in visa mrz.
|
|
5043
|
+
* @ignore
|
|
5044
|
+
*/
|
|
5045
|
+
declare function checkValidMRV(code: string): boolean;
|
|
5046
|
+
/**
|
|
5047
|
+
* check if the two row or third row of id card mrz code is valid.
|
|
5048
|
+
* check digit only exits in two row or third row in id card mrz.
|
|
5049
|
+
* @ignore
|
|
5050
|
+
*/
|
|
5051
|
+
declare function checkValidIDCard(code: string, codeUpperLine?: string): boolean;
|
|
5052
|
+
declare const utilsFuncs: {
|
|
5053
|
+
filterVINResult: typeof filterVINResult;
|
|
5054
|
+
checkValidVIN: typeof checkValidVIN;
|
|
5055
|
+
checkValidMRP: typeof checkValidMRP;
|
|
5056
|
+
checkValidMRV: typeof checkValidMRV;
|
|
5057
|
+
checkValidIDCard: typeof checkValidIDCard;
|
|
5058
|
+
};
|
|
5059
|
+
|
|
5060
|
+
/**
|
|
5061
|
+
* Enumerates the status of a raw text line.
|
|
5062
|
+
*/
|
|
5063
|
+
declare enum EnumRawTextLineStatus {
|
|
5064
|
+
/** Localized but recognition not performed. */
|
|
5065
|
+
RTLS_LOCALIZED = 0,
|
|
5066
|
+
/** Recognition failed. */
|
|
5067
|
+
RTLS_RECOGNITION_FAILED = 1,
|
|
5068
|
+
/** Successfully recognized. */
|
|
5069
|
+
RTLS_RECOGNITION_SUCCEEDED = 2
|
|
5070
|
+
}
|
|
5071
|
+
|
|
5072
|
+
interface LocalizedTextLineElement extends RegionObjectElement {
|
|
5073
|
+
/** Quadrilaterals for each character in the text line. */
|
|
5074
|
+
characterQuads: Array<Quadrilateral>;
|
|
5075
|
+
/** The row number of the text line, starting from 1. */
|
|
5076
|
+
rowNumber: number;
|
|
5077
|
+
}
|
|
5078
|
+
|
|
5079
|
+
interface LocalizedTextLinesUnit extends IntermediateResultUnit {
|
|
5080
|
+
/** An array of `LocalizedTextLineElement` objects, each representing a localized text line. */
|
|
5081
|
+
localizedTextLines: Array<LocalizedTextLineElement>;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
5084
|
+
interface RecognizedTextLineElement extends RegionObjectElement {
|
|
5085
|
+
/** The recognized text of the line. */
|
|
5086
|
+
text: string;
|
|
5087
|
+
/** Confidence score for the recognized text line. */
|
|
5088
|
+
confidence: number;
|
|
5089
|
+
/** Results for individual characters within the text line. */
|
|
5090
|
+
characterResults: Array<CharacterResult>;
|
|
5091
|
+
/** The row number of the text line, starting from 1. */
|
|
5092
|
+
rowNumber: number;
|
|
5093
|
+
/** The name of the TextLineSpecification object that generated this RecognizedTextLineElement. */
|
|
5094
|
+
specificationName: string;
|
|
5095
|
+
/** The recognized raw text of the line. */
|
|
5096
|
+
rawText: string;
|
|
5097
|
+
}
|
|
5098
|
+
|
|
5099
|
+
interface RecognizedTextLinesResult extends CapturedResultBase {
|
|
5100
|
+
/**
|
|
5101
|
+
* An array of `TextLineResultItem` objects, each representing a recognized text line within the original image.
|
|
5102
|
+
*/
|
|
5103
|
+
textLineResultItems: Array<TextLineResultItem>;
|
|
5104
|
+
}
|
|
5105
|
+
|
|
5106
|
+
interface SimplifiedLabelRecognizerSettings {
|
|
5107
|
+
/** Name of the character model used for recognition. */
|
|
5108
|
+
characterModelName: string;
|
|
5109
|
+
/** Regular expression pattern for validating recognized line strings. */
|
|
5110
|
+
lineStringRegExPattern: string;
|
|
5111
|
+
/** Grayscale transformation modes to apply, enhancing detection capability. */
|
|
5112
|
+
grayscaleTransformationModes: Array<EnumGrayscaleTransformationMode>;
|
|
5113
|
+
/** Grayscale enhancement modes to apply for improving detection in challenging conditions. */
|
|
5114
|
+
grayscaleEnhancementModes: Array<EnumGrayscaleEnhancementMode>;
|
|
5115
|
+
/**
|
|
5116
|
+
* Threshold for reducing the size of large images to speed up processing. If the size of the image's shorter edge exceeds this threshold, the image may be downscaled to decrease processing time. The standard setting is 2300. */
|
|
5117
|
+
scaleDownThreshold: number;
|
|
5118
|
+
}
|
|
5119
|
+
|
|
5120
|
+
interface BufferedCharacterItem {
|
|
5121
|
+
/** The buffered character value. */
|
|
5122
|
+
character: string;
|
|
5123
|
+
/** The image data of the buffered character. */
|
|
5124
|
+
image: DSImageData;
|
|
5125
|
+
/** An array of features, each feature object contains feature id and value of the buffered character.*/
|
|
5126
|
+
features: Map<number, number>;
|
|
5127
|
+
}
|
|
5128
|
+
|
|
5129
|
+
interface CharacterCluster {
|
|
5130
|
+
/** The character value of the cluster. */
|
|
5131
|
+
character: string;
|
|
5132
|
+
/** The mean of the cluster. */
|
|
5133
|
+
mean: BufferedCharacterItem;
|
|
5134
|
+
}
|
|
5135
|
+
|
|
5136
|
+
interface BufferedCharacterItemSet {
|
|
5137
|
+
/** An array of BufferedCharacterItem. */
|
|
5138
|
+
items: Array<BufferedCharacterItem>;
|
|
5139
|
+
/** An array of CharacterCluster. */
|
|
5140
|
+
characterClusters: Array<CharacterCluster>;
|
|
5141
|
+
}
|
|
5142
|
+
|
|
5143
|
+
/**
|
|
5144
|
+
* The `RawTextLine` represents a text line in an image. It can be in one of the following states:
|
|
5145
|
+
* - `TLS_LOCALIZED`: Localized but recognition not performed.
|
|
5146
|
+
* - `TLS_RECOGNITION_FAILED`: Recognition failed.
|
|
5147
|
+
* - `TLS_RECOGNIZED_SUCCESSFULLY`: Successfully recognized.
|
|
5148
|
+
*/
|
|
5149
|
+
interface RawTextLine extends RegionObjectElement {
|
|
5150
|
+
/** The recognized text of the line. */
|
|
5151
|
+
text: string;
|
|
5152
|
+
/** Confidence score for the recognized text line. */
|
|
5153
|
+
confidence: number;
|
|
5154
|
+
/** Results for individual characters within the text line. */
|
|
5155
|
+
characterResults: Array<CharacterResult>;
|
|
5156
|
+
/** The row number of the text line, starting from 1. */
|
|
5157
|
+
rowNumber: number;
|
|
5158
|
+
/** The predefined specification name of this text line*/
|
|
5159
|
+
specificationName: string;
|
|
5160
|
+
/** The location of the text line */
|
|
5161
|
+
location: Quadrilateral;
|
|
5162
|
+
/** The status of a raw text line.*/
|
|
5163
|
+
status: EnumRawTextLineStatus;
|
|
5164
|
+
}
|
|
5165
|
+
|
|
5166
|
+
interface RawTextLinesUnit extends IntermediateResultUnit {
|
|
5167
|
+
/** An array of RawTextLine. */
|
|
5168
|
+
rawTextlines: Array<RawTextLine>;
|
|
5169
|
+
}
|
|
5170
|
+
|
|
5171
|
+
interface RecognizedTextLinesUnit extends IntermediateResultUnit {
|
|
5172
|
+
recognizedTextLines: Array<RecognizedTextLineElement>;
|
|
5173
|
+
}
|
|
5174
|
+
|
|
5175
|
+
export { BufferedCharacterItem, BufferedCharacterItemSet, CharacterCluster, CharacterResult, EnumRawTextLineStatus, LabelRecognizerModule, LocalizedTextLineElement, LocalizedTextLinesUnit, RawTextLine, RawTextLinesUnit, RecognizedTextLineElement, RecognizedTextLinesResult, RecognizedTextLinesUnit, SimplifiedLabelRecognizerSettings, TextLineResultItem, utilsFuncs };
|
|
5176
|
+
|
|
4766
5177
|
declare class LicenseModule {
|
|
4767
5178
|
/**
|
|
4768
5179
|
* Returns the version of the License module.
|
|
@@ -4821,26 +5232,18 @@ declare class UtilityModule {
|
|
|
4821
5232
|
static getVersion(): string;
|
|
4822
5233
|
}
|
|
4823
5234
|
|
|
4824
|
-
type resultItemTypesString = "barcode" | "text_line" | "detected_quad" | "deskewed_image";
|
|
5235
|
+
type resultItemTypesString = "barcode" | "text_line" | "detected_quad" | "deskewed_image" | "enhanced_image";
|
|
5236
|
+
type CapturedResultMap<T> = {
|
|
5237
|
+
[K in EnumCapturedResultItemType]?: T;
|
|
5238
|
+
};
|
|
4825
5239
|
|
|
4826
5240
|
declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
|
|
4827
5241
|
#private;
|
|
4828
5242
|
constructor();
|
|
4829
|
-
verificationEnabled:
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
[key: number]: boolean;
|
|
4834
|
-
};
|
|
4835
|
-
duplicateForgetTime: {
|
|
4836
|
-
[key: number]: number;
|
|
4837
|
-
};
|
|
4838
|
-
private latestOverlappingEnabled;
|
|
4839
|
-
private maxOverlappingFrames;
|
|
4840
|
-
private overlapSet;
|
|
4841
|
-
private stabilityCount;
|
|
4842
|
-
private crossVerificationFrames;
|
|
4843
|
-
_dynamsoft(): void;
|
|
5243
|
+
verificationEnabled: CapturedResultMap<boolean>;
|
|
5244
|
+
duplicateFilterEnabled: CapturedResultMap<boolean>;
|
|
5245
|
+
duplicateForgetTime: CapturedResultMap<number>;
|
|
5246
|
+
private _dynamsoft;
|
|
4844
5247
|
/**
|
|
4845
5248
|
* Enables or disables the verification of one or multiple specific result item types.
|
|
4846
5249
|
* @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
|
|
@@ -4877,19 +5280,12 @@ declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
|
|
|
4877
5280
|
* @returns The set interval for the specified item type.
|
|
4878
5281
|
*/
|
|
4879
5282
|
getDuplicateForgetTime(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString): number;
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
setMaxOverlappingFrames(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, maxOverlappingFrames: number): void;
|
|
4887
|
-
/**
|
|
4888
|
-
* Get the max referencing frames count for the to-the-latest overlapping feature.
|
|
4889
|
-
* @param resultItemTypes Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
|
|
4890
|
-
* @return Returns the max referencing frames count for the to-the-latest overlapping feature.
|
|
4891
|
-
*/
|
|
4892
|
-
getMaxOverlappingFrames(resultItemType: EnumCapturedResultItemType): number;
|
|
5283
|
+
getFilteredResultItemTypes(): number;
|
|
5284
|
+
private overlapSet;
|
|
5285
|
+
private stabilityCount;
|
|
5286
|
+
private crossVerificationFrames;
|
|
5287
|
+
private latestOverlappingEnabled;
|
|
5288
|
+
private maxOverlappingFrames;
|
|
4893
5289
|
/**
|
|
4894
5290
|
* Enables or disables the deduplication process for one or multiple specific result item types.
|
|
4895
5291
|
* @param resultItemTypes Specifies one or multiple specific result item types, which can be defined using EnumCapturedResultItemType or a string. If using a string, only one type can be specified, and valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
|
|
@@ -4903,7 +5299,19 @@ declare class MultiFrameResultCrossFilter implements CapturedResultFilter {
|
|
|
4903
5299
|
* @returns Boolean indicating the deduplication status for the specified type.
|
|
4904
5300
|
*/
|
|
4905
5301
|
isLatestOverlappingEnabled(resultItemType: EnumCapturedResultItemType | resultItemTypesString): boolean;
|
|
4906
|
-
|
|
5302
|
+
/**
|
|
5303
|
+
* Set the max referencing frames count for the to-the-latest overlapping feature.
|
|
5304
|
+
*
|
|
5305
|
+
* @param resultItemTypes Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
|
|
5306
|
+
* @param maxOverlappingFrames The max referencing frames count for the to-the-latest overlapping feature.
|
|
5307
|
+
*/
|
|
5308
|
+
setMaxOverlappingFrames(resultItemTypes: EnumCapturedResultItemType | resultItemTypesString, maxOverlappingFrames: number): void;
|
|
5309
|
+
/**
|
|
5310
|
+
* Get the max referencing frames count for the to-the-latest overlapping feature.
|
|
5311
|
+
* @param resultItemTypes Specifies the result item type, either with EnumCapturedResultItemType or a string. When using a string, the valid values include "barcode", "text_line", "detected_quad", and "normalized_image".
|
|
5312
|
+
* @return Returns the max referencing frames count for the to-the-latest overlapping feature.
|
|
5313
|
+
*/
|
|
5314
|
+
getMaxOverlappingFrames(resultItemType: EnumCapturedResultItemType): number;
|
|
4907
5315
|
latestOverlappingFilter(result: any): void;
|
|
4908
5316
|
}
|
|
4909
5317
|
|