Skip to content

Commit e613803

Browse files
committed
fix bugs
1 parent 2fd0045 commit e613803

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

programming/javascript/api-reference/capture-vision-router/multiple-file-processing.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,11 @@ None.
219219

220220
```javascript
221221
cvr = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
222-
let crr = {
223-
async onDetectedQuadsReceived(result) {
224-
items = result.quadsResultItems;
225-
}
226-
};
227-
cvr.addResultReceiver(crr);
222+
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
223+
resultReceiver.onDetectedQuadsReceived(result) {
224+
//* Do something with the result */
225+
};
226+
cvr.addResultReceiver(resultReceiver);
228227
```
229228

230229
## removeResultReceiver
@@ -249,13 +248,12 @@ None.
249248

250249
```javascript
251250
cvr = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
252-
let crr = {
253-
async onDetectedQuadsReceived(result) {
254-
items = result.quadsResultItems;
255-
}
256-
};
257-
cvr.addResultReceiver(crr);
258-
cvr.removeResultReceiver(crr);
251+
const resultReceiver = new Dynamsoft.CVR.CapturedResultReceiver();
252+
resultReceiver.onDetectedQuadsReceived(result) {
253+
//* Do something with the result */
254+
};
255+
cvr.addResultReceiver(resultReceiver);
256+
cvr.removeResultReceiver(resultReceiver);
259257
```
260258

261259
## addResultFilter
@@ -282,6 +280,12 @@ cvr = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
282280
cvr.addResultReceiver(filter);
283281
```
284282

283+
> In the provided code snippet, the default filter implementation is utilized. This filter can offer cross-validation and de-duplication functionalities. To utilize this filter, it's necessary to include the corresponding package `dynamsoft-utility`.
284+
285+
**See also**
286+
287+
[`MultiFrameResultCrossFilter`](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/utility/multi-frame-result-cross-filter.html?product=ddn&repoType=web)
288+
285289
## removeResultFilter
286290

287291
**Syntax**
@@ -329,7 +333,7 @@ None.
329333

330334
```javascript
331335
cvr = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
332-
cvr.startCapturing();
336+
await cvr.startCapturing();
333337
```
334338

335339
## stopCapturing

programming/javascript/api-reference/capture-vision-router/settings.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ outputSettings(templateName?: string): Promise<string>;
6464

6565
**Parameters**
6666

67-
`templateName (optional)`: The name of the template for which to output the settings. If not specified, the settings currently in effect will be returned.
67+
`templateName`(optional): The name of the template for which to output the settings. If not specified, the settings currently in effect will be returned.
6868

6969
**Return value**
7070

@@ -118,6 +118,7 @@ updateSettings(templateName: string, settings: SimplifiedCaptureVisionSettings):
118118
**parameter**
119119

120120
`templateName`: The name of the template to be updated with the provided settings.
121+
121122
`settings`: The SimplifiedCaptureVisionSettings object containing the new values for the template.
122123

123124
**Return Value**
@@ -128,11 +129,10 @@ Returns a promise that resolves when the template settings have been successfull
128129

129130
```javascript
130131
let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
131-
const newSettings=`{
132-
"templateName": "myTemplate",
133-
"ScaleDownThreshold" : 2000
134-
}`;
135-
await router.updateSettings('myTemplate',newSettings);
132+
let newSettings = await cvr.getSimplifiedSettings("normalize-document");
133+
newSettings.timeout = 5000;
134+
// Change the timeout of preset templates "normalize-document"
135+
await cvr.updateSettings("normalize-document", newSettings);
136136
```
137137

138138
> Note: The updateSettings method allows you to update a template's settings with new values. It is specifically designed for fast configuration of the image processing process, with certain limitations:

programming/javascript/api-reference/capture-vision-router/single-file-processing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Process an image or file to derive important information.
2323
**Syntax**
2424

2525
```typescript
26-
capture(imageOrFile: Core.BasicStructures.DSImageData | string | Blob, templateName?: string): Promise<Array<Core.BasicStructures.CapturedResult>>;
26+
capture(imageOrFile: Core.BasicStructures.DSImageData | string | Blob | HTMLImageElement | HTMLCanvasElement, templateName?: string): Promise<Array<Core.BasicStructures.CapturedResult>>;
2727
```
2828

2929
**Parameters**
3030

31-
`imageOrFile`: specifies the image or file to be processed. It can be the image itself in the form of `DSImageData`, the path of the image/file or the file itself in the form of `blob`. A file could contain one or multiple images.
31+
`imageOrFile`: specifies the image or file to be processed. It can be the image itself in the form of `DSImageData`, the path of the image/file or the file itself in the form of `blob`, `HTMLImageElement` or `HTMLCanvasElement`.
3232

3333
`templateName`: specifies a [CaptureVisionTemplate]({{site.parameterFile}}capture-vision-template.html) to use. If not specified, the default one is used.
3434

@@ -40,7 +40,7 @@ A promise that resolves to an array of `CapturedResult` objects which are the de
4040

4141
```javascript
4242
let router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
43-
let results = await router.catpure("blob:https://demo.dynamsoft.com/afb84bd2-e8cb-4b96-92b6-36dc89783692", "read-barcodes");
43+
let results = await router.catpure("blob:https://demo.dynamsoft.com/afb84bd2-e8cb-4b96-92b6-36dc89783692", "detect-document-boundaries");
4444
let count = results.length;
4545
for(let i = 0; i < count; i++) {
4646
//...

0 commit comments

Comments
 (0)