Skip to content

Commit 24efaa0

Browse files
authored
Create remove-duplicates.md
1 parent 93fa169 commit 24efaa0

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
layout: default-layout
3+
title: How to Reduce Duplicate Scans and Optimize Scan Usage
4+
keywords: Dynamsoft Barcode Reader, FAQ, JavaScript, tech basic, scans, duplicate, re-reads
5+
description: How to Reduce Duplicate Scans and Optimize Scan Usage
6+
needAutoGenerateSidebar: false
7+
---
8+
9+
# How to Reduce Duplicate Scans and Optimize Scan Usage?
10+
11+
[<< Back to FAQ index](index.md)
12+
13+
## Version 10
14+
If you're experiencing more scans usage than expected with the barcode reading SDK, use the below strategies to address this issue effectively:
15+
16+
### 1. Donot count identical Result
17+
With version 10 and above of the DBR SDK, the `enableResultDeduplication` is set to forget a result 3 seconds after it is first received. During this time frame, if an identical result appears, it is ignored. If you want to forget the identical result for more duration you can use the setDuplicateForgetTime function as well with `enableResultDeduplication`.
18+
19+
```javascript
20+
// Filter out unchecked and duplicate results.
21+
const filter = new MultiFrameResultCrossFilter();
22+
// Filter out unchecked barcodes
23+
filter.enableResultCrossVerification(
24+
EnumCapturedResultItemType.CRIT_BARCODE,
25+
true
26+
);
27+
// Filter out duplicate barcodes within 3 seconds by default.
28+
filter.enableResultDeduplication(
29+
EnumCapturedResultItemType.CRIT_BARCODE,
30+
true
31+
);
32+
// Filter out duplicate barcodes within 5 seconds.
33+
filter.setDuplicateForgetTime(
34+
EnumCapturedResultItemType.CRIT_BARCODE,
35+
5000
36+
);
37+
await router.addResultFilter(filter);
38+
```
39+
**_NOTE:_** - setSuplicateForgetTime can be set upto 10 seconds.
40+
41+
### 2. Limit Barcode Formats:
42+
If you're specifically scanning a particular barcode format, consider limiting the barcode format options to prevent other formats from being decoded and counted unnecessarily.
43+
44+
you can limit the barcode formats in two ways:
45+
46+
- set the barcode format using the `getSimplifiedSettings`
47+
```javascript
48+
let settings = await router.getSimplifiedSettings("ReadSingleBarcode");
49+
settings.barcodeSettings.barcodeFormatIds =
50+
Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED |
51+
Dynamsoft.DBR.EnumBarcodeFormat.BF_QR_CODE ;
52+
await router.updateSettings("ReadSingleBarcode", settings);
53+
```
54+
55+
- to set the barcode format using the template check out the [template section]({{site.dcv_js_api}}capture-vision-router/settings.html)
56+
57+
58+
Implementing these steps can help streamline your barcode scanning process, reduce unnecessary scans, and optimize resource usage effectively.

0 commit comments

Comments
 (0)