Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
yushulx committed Aug 5, 2024
1 parent 7d1f5e7 commit 9fe8e63
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
30 changes: 18 additions & 12 deletions src/app/mrz-reader/mrz-reader.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ export class MrzReaderComponent implements OnInit {
this.overlayManager.initOverlay(document.getElementById('overlay') as HTMLCanvasElement);

(async () => {
await CodeParserModule.loadSpec("MRTD_TD1_ID");
await CodeParserModule.loadSpec("MRTD_TD2_FRENCH_ID");
await CodeParserModule.loadSpec("MRTD_TD2_ID");
await CodeParserModule.loadSpec("MRTD_TD2_VISA");
await CodeParserModule.loadSpec("MRTD_TD3_PASSPORT");
await CodeParserModule.loadSpec("MRTD_TD3_VISA");

await LabelRecognizerModule.loadRecognitionData("MRZ");
this.cvr = await CaptureVisionRouter.createInstance();
this.parser = await CodeParser.createInstance();
let ret = await this.cvr.initSettings('/assets/template.json');
console.log(ret);
try {
await CodeParserModule.loadSpec("MRTD_TD1_ID");
await CodeParserModule.loadSpec("MRTD_TD2_FRENCH_ID");
await CodeParserModule.loadSpec("MRTD_TD2_ID");
await CodeParserModule.loadSpec("MRTD_TD2_VISA");
await CodeParserModule.loadSpec("MRTD_TD3_PASSPORT");
await CodeParserModule.loadSpec("MRTD_TD3_VISA");

await LabelRecognizerModule.loadRecognitionData("MRZ");
this.cvr = await CaptureVisionRouter.createInstance();
this.parser = await CodeParser.createInstance();
let ret = await this.cvr.initSettings('/assets/template.json');
console.log(ret);
}
catch (ex) {
alert(ex);
// console.error(ex);
}
this.isLoaded = true;
})();
}
Expand Down
24 changes: 12 additions & 12 deletions src/app/product-list/product-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ export class ProductListComponent {
this.processedText = this.inputText.toUpperCase();
// Configure the paths where the .wasm files and other necessary resources for modules are located.
CoreModule.engineResourcePaths = {
std: '/assets/dynamsoft-capture-vision-std/',
dip: '/assets/dynamsoft-image-processing/',
core: '/assets/dynamsoft-core/',
license: '/assets/dynamsoft-license/',
cvr: '/assets/dynamsoft-capture-vision-router/',
dbr: '/assets/dynamsoft-barcode-reader/',
dce: '/assets/dynamsoft-camera-enhancer/',
ddn: '/assets/dynamsoft-document-normalizer/',
dlr: '/assets/dynamsoft-label-recognizer/',
dcp: '/assets/dynamsoft-code-parser/',
dnn: '/assets/dynamsoft-capture-vision-dnn/',
dlrData: '/assets/dynamsoft-label-recognizer-data',
std: 'assets/dynamsoft-capture-vision-std/',
dip: 'assets/dynamsoft-image-processing/',
core: 'assets/dynamsoft-core/',
license: 'assets/dynamsoft-license/',
cvr: 'assets/dynamsoft-capture-vision-router/',
dbr: 'assets/dynamsoft-barcode-reader/',
dce: 'assets/dynamsoft-camera-enhancer/',
ddn: 'assets/dynamsoft-document-normalizer/',
dlr: 'https://cdn.jsdelivr.net/npm/dynamsoft-label-recognizer@3.2.30/dist/',
dcp: 'https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.2.10/dist/',
dnn: 'assets/dynamsoft-capture-vision-dnn/',
dlrData: 'assets/dynamsoft-label-recognizer-data',
};

try {
Expand Down

0 comments on commit 9fe8e63

Please sign in to comment.