Skip to content

Commit c18ac91

Browse files
committed
update anycode sample
1 parent 65f7fe5 commit c18ac91

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ <h3>Scenario Samples <span class="sample-count">(16)</span></h3>
815815
</div>
816816
<div class="file"><span data-balloon-length="large" data-balloon-pos="down" aria-label="1D industrial barcode tuning example (Code 39, Code 128, etc.)."><a class="button title demo-link" href="scenarios/scan-1D-Industrial/index.html" title="View live demo">Scan 1D Industrial Barcodes</a><a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/scan-1D-Industrial" title="View source code on GitHub">Source</a></span>
817817
</div>
818-
<div class="file"><span data-balloon-length="large" data-balloon-pos="down" aria-label="Demo configured to detect a wide range of barcode formats."><a class="button title demo-link" href="scenarios/scan-any-codes/index.html" title="View live demo">Scan Any Codes</a><a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/scan-any-codes" title="View source code on GitHub">Source</a></span>
818+
<div class="file"><span data-balloon-length="large" data-balloon-pos="down" aria-label="Demo configured to detect a wide range of barcode formats."><a class="button title demo-link" href="scenarios/scan-common-1D-and-2D/index.html" title="View live demo">Scan Any Codes</a><a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/scan-common-1D-and-2D" title="View source code on GitHub">Source</a></span>
819819
</div>
820820
<div class="file"><span data-balloon-length="large" data-balloon-pos="down" aria-label="Demo for scanning barcodes from a distance with zoom and ROI tuning."><a class="button title demo-link" href="scenarios/scan-from-distance/index.html" title="View live demo">Scan from Distance</a><a class="button title source-link" href="https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/scenarios/scan-from-distance" title="View source code on GitHub">Source</a></span>
821821
</div>

scenarios/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Included samples
1212
- [read-a-drivers-license/](./read-a-drivers-license/) — Demo for reading and parsing a driver's license image/data.
1313
- [read-and-parse-GS1-AI/](./read-and-parse-GS1-AI/) — Example showing GS1 AI parsing and data extraction.
1414
- [scan-qr-code/](./scan-qr-code/) — QR code targeted demo and settings.
15-
- [scan-any-codes/](./scan-any-codes/) — Demo configured to detect a wide range of barcode formats.
15+
- [scan-common-1D-and-2D/](./scan-common-1D-and-2D/) — Demo configured to detect a wide range of barcode formats.
1616
- [scan-common-2D-codes/](./scan-common-2D-codes/) — Focused on common 2D barcode formats decoding.
1717
- [scan-1D-Retail/](./scan-1D-Retail/) — 1D retail barcode tuning example.
1818
- [scan-1D-Industrial/](./scan-1D-Industrial/) — 1D industrial barcode tuning example.

scenarios/scan-any-codes/ReadAllBarcodeFormats.json renamed to scenarios/scan-common-1D-and-2D/ReadCommon1DAnd2D.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
},
66
"CaptureVisionTemplates": [
77
{
8-
"Name": "ReadAllBarcodeFormats",
8+
"Name": "ReadCommon1DAnd2D",
99
"ImageROIProcessingNameArray": [
1010
"roi-read-barcodes"
1111
],
1212
"Timeout": 1000,
1313
"MaxParallelTasks": 0
1414
},
1515
{
16-
"Name": "ReadAllBarcodeFormats_DecodeImage",
16+
"Name": "ReadCommon1DAnd2D_ReadRate",
1717
"ImageROIProcessingNameArray": [
18-
"roi-read-barcodes-decode-image"
18+
"roi-read-barcodes-read-rate"
1919
],
2020
"Timeout": 10000,
2121
"MaxParallelTasks": 0
@@ -29,16 +29,15 @@
2929
]
3030
},
3131
{
32-
"Name": "roi-read-barcodes-decode-image",
32+
"Name": "roi-read-barcodes-read-rate",
3333
"TaskSettingNameArray": [
34-
"task-read-barcodes-decode-image"
34+
"task-read-barcodes-read-rate"
3535
]
3636
}
3737
],
3838
"BarcodeReaderTaskSettingOptions": [
3939
{
4040
"Name": "task-read-barcodes",
41-
"BarcodeFormatIds": ["BF_ALL"],
4241
"ExpectedBarcodesCount": 0,
4342
"MaxThreadsInOneTask": 1,
4443
"SectionArray": [
@@ -53,8 +52,8 @@
5352
"Mode": "LM_CONNECTED_BLOCKS"
5453
},
5554
{
56-
"Mode": "LM_LINES"
57-
}
55+
"Mode": "LM_SCAN_DIRECTLY"
56+
}
5857
]
5958
},
6059
{
@@ -67,28 +66,38 @@
6766
"ImageParameterName": "ip-read-barcodes",
6867
"StageArray": [
6968
{
70-
"Stage": "SST_DECODE_BARCODES",
7169
"DeblurModes": [
7270
{
73-
"Mode": "DM_DIRECT_BINARIZATION"
71+
"Mode": "DM_BASED_ON_LOC_BIN"
7472
},
7573
{
76-
"Mode": "DM_NEURAL_NETWORK"
74+
"Mode": "DM_THRESHOLD_BINARIZATION"
7775
},
7876
{
79-
"Mode": "DM_DEEP_ANALYSIS"
77+
"Mode": "DM_NEURAL_NETWORK",
78+
"ModelNameArray": [
79+
"Code128Decoder",
80+
"EAN13Decoder"
81+
]
82+
},
83+
{
84+
"Mode": "DM_DEEP_ANALYSIS",
85+
"Methods": ["OneDGeneral","TwoDGeneral"]
8086
}
81-
]
87+
],
88+
"Stage": "SST_DECODE_BARCODES"
8289
}
8390
]
8491
}
8592
]
8693
},
8794
{
88-
"Name": "task-read-barcodes-decode-image",
89-
"ExpectedBarcodesCount": 999,
95+
"Name": "task-read-barcodes-read-rate",
96+
"ExpectedBarcodesCount": 0,
9097
"MaxThreadsInOneTask": 1,
91-
"BarcodeFormatIds": ["BF_ALL"],
98+
"BarcodeFormatIds": [
99+
"BF_DEFAULT"
100+
],
92101
"SectionArray": [
93102
{
94103
"Section": "ST_BARCODE_LOCALIZATION",
@@ -99,16 +108,10 @@
99108
"LocalizationModes": [
100109
{
101110
"Mode": "LM_CONNECTED_BLOCKS"
102-
},
103-
{
104-
"Mode": "LM_LINES"
105-
},
106-
{
107-
"Mode": "LM_STATISTICS"
108111
},
109112
{
110113
"Mode": "LM_NEURAL_NETWORK"
111-
}
114+
}
112115
]
113116
}
114117
]
@@ -131,9 +134,6 @@
131134
},
132135
{
133136
"Mode": "DM_NEURAL_NETWORK"
134-
},
135-
{
136-
"Mode": "DM_SMOOTHING"
137137
},
138138
{
139139
"Mode": "DM_DEEP_ANALYSIS"

scenarios/scan-any-codes/index.html renamed to scenarios/scan-common-1D-and-2D/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<meta charset="UTF-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>
8-
Dynamsoft Barcode Scanner Sample - Scan Any codes
8+
Dynamsoft Barcode Scanner Sample - Scan Common 1D And 2D
99
</title>
1010
</head>
1111

1212
<body>
1313
<h1 class="barcode-scanner-title">
14-
Scan Any codes
14+
Scan Common 1D And 2D
1515
</h1>
1616
<!-- This div will host the barcode scanner's camera view -->
1717
<div class="barcode-scanner-view"></div>
@@ -31,10 +31,10 @@ <h1 class="barcode-scanner-title">
3131
showFlashButton: true,
3232
cameraSwitchControl: "toggleFrontBack",
3333
},
34-
templateFilePath:'./ReadAllBarcodeFormats.json',
35-
utilizedTemplateNames:{"single": "ReadAllBarcodeFormats",
36-
"multi_unique": "ReadAllBarcodeFormats",
37-
"image": "ReadAllBarcodeFormats_DecodeImage"},
34+
templateFilePath:'./ReadCommon1DAnd2D.json',
35+
utilizedTemplateNames:{"single": "ReadCommon1DAnd2D",
36+
"multi_unique": "ReadCommon1DAnd2D",
37+
"image": "ReadCommon1DAnd2D_ReadRate"},
3838
onInitReady: (components) => {
3939
// Set the scan region to a rectangle with percentage values by cameraEnhancer
4040
let region = {

0 commit comments

Comments
 (0)