Skip to content

Commit 91ebb37

Browse files
committed
update template
1 parent d0eae55 commit 91ebb37

File tree

18 files changed

+424
-67
lines changed

18 files changed

+424
-67
lines changed

scenarios/scan-1D-Industrial/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This sample demonstrates tuning for industrial 1D barcodes (high-density, damage
55
## Included files
66

77
- `index.html` — Demo page and UI.
8-
- `ReadOneDIndustrial.json` — Example configuration used by the sample (if present).
8+
- `ReadOneDIndustrial.json` — Example configuration used by the sample.
99

1010
## Quick start
1111

scenarios/scan-1D-Industrial/ReadOneDIndustrial.json

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
],
1111
"Name": "ReadOneDIndustrial",
1212
"MaxParallelTasks": 0,
13-
"Timeout": 500
13+
"Timeout": 1000
14+
},
15+
{
16+
"ImageROIProcessingNameArray": [
17+
"ROI_Industrial_ReadRate"
18+
],
19+
"Name": "ReadOneDIndustrial_ReadRate",
20+
"MaxParallelTasks": 0,
21+
"Timeout": 10000
1422
}
1523
],
1624
"TargetROIDefOptions": [
@@ -19,13 +27,20 @@
1927
"TaskSettingNameArray": [
2028
"Task_Industrial"
2129
]
30+
},
31+
{
32+
"Name": "ROI_Industrial_ReadRate",
33+
"TaskSettingNameArray": [
34+
"Task_Industrial_ReadRate"
35+
]
2236
}
2337
],
2438
"BarcodeReaderTaskSettingOptions": [
2539
{
2640
"Name": "Task_Industrial",
41+
"BarcodeFormatSpecificationNameArray": ["bfs1"],
2742
"BarcodeFormatIds": ["BF_CODE_128", "BF_CODE_39", "BF_ITF", "BF_CODABAR", "BF_MSI_CODE "],
28-
"ExpectedBarcodesCount":0,
43+
"ExpectedBarcodesCount":1,
2944
"MaxThreadsInOneTask": 1,
3045
"SectionArray": [
3146
{
@@ -35,16 +50,11 @@
3550
{
3651
"Stage": "SST_LOCALIZE_CANDIDATE_BARCODES",
3752
"LocalizationModes": [
38-
{
39-
"Mode": "LM_SCAN_DIRECTLY",
40-
"ScanDirection": 2
41-
},
4253
{
4354
"Mode": "LM_CONNECTED_BLOCKS"
4455
},
4556
{
46-
"Mode": "LM_NEURAL_NETWORK",
47-
"ModelNameArray": ["OneDLocalization"]
57+
"Mode": "LM_SCAN_DIRECTLY"
4858
}
4959
]
5060
}
@@ -72,12 +82,62 @@
7282
]
7383
}
7484
]
85+
},
86+
{
87+
"Name": "Task_Industrial_ReadRate",
88+
"BarcodeFormatSpecificationNameArray": ["bfs1"],
89+
"BarcodeFormatIds": ["BF_CODE_128", "BF_CODE_39", "BF_ITF", "BF_CODABAR", "BF_MSI_CODE "],
90+
"ExpectedBarcodesCount": 999,
91+
"MaxThreadsInOneTask": 1,
92+
"SectionArray": [
93+
{
94+
"Section": "ST_BARCODE_LOCALIZATION",
95+
"ImageParameterName": "ip",
96+
"StageArray": [
97+
{
98+
"Stage": "SST_LOCALIZE_CANDIDATE_BARCODES",
99+
"LocalizationModes": [
100+
{
101+
"Mode": "LM_CONNECTED_BLOCKS"
102+
},
103+
{
104+
"Mode": "LM_SCAN_DIRECTLY"
105+
},
106+
{
107+
"Mode": "LM_NEURAL_NETWORK"
108+
}
109+
]
110+
}
111+
]
112+
},
113+
{
114+
"Section": "ST_BARCODE_DECODING",
115+
"ImageParameterName": "ip",
116+
"StageArray": [
117+
{
118+
"Stage": "SST_DECODE_BARCODES",
119+
"DeblurModes": null
120+
}
121+
]
122+
}
123+
]
75124
}
125+
],
126+
"BarcodeFormatSpecificationOptions": [
127+
{
128+
"Name": "bfs1",
129+
"BarcodeZoneMinDistanceToImageBorders": 10,
130+
"MinQuietZoneWidth": 6
131+
}
76132
],
77133
"ImageParameterOptions": [
78134
{
79135
"ApplicableStages": [
80136
{
137+
"ImageScaleSetting": {
138+
"EdgeLengthThreshold": 100000,
139+
"ScaleType": "ST_SCALE_DOWN"
140+
},
81141
"Stage": "SST_SCALE_IMAGE"
82142
},
83143
{

scenarios/scan-1D-Industrial/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1 class="barcode-scanner-title">
3434
templateFilePath:'./ReadOneDIndustrial.json',
3535
utilizedTemplateNames:{"single": "ReadOneDIndustrial",
3636
"multi_unique": "ReadOneDIndustrial",
37-
"image": "ReadOneDIndustrial"},
37+
"image": "ReadOneDIndustrial_ReadRate"},
3838
onInitReady: (components) => {
3939
// Set the scan region to a rectangle with percentage values by cameraEnhancer
4040
let region = {

scenarios/scan-1D-Retail/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Scan 1D Retail
2+
3+
This sample demonstrates tuning for retail 1D barcodes (high-density, damaged, or specialized 1D formats) using the Dynamsoft Barcode Reader (JavaScript edition).
4+
5+
## Included files
6+
7+
- `index.html` — Demo page and UI.
8+
- `ReadOneDRetail.json` — Example configuration used by the sample.
9+
10+
## Quick start
11+
12+
Opening HTML files directly may not work as expected. Instead, run a local development server. Here’s a quick method using [Visual Studio Code](https://code.visualstudio.com/):
13+
14+
1. Install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server) from the VS Code Marketplace.
15+
16+
2. Right-click on `index.html` and select "Open with Five Server". This will serve the application at `http://127.0.0.1:5500/index.html`.
17+
18+
3. Allow camera access when prompted and point the camera at a barcode.
19+
20+
## What this sample shows
21+
22+
- Decoder parameters targeted for retail 1D symbols (damage-tolerance, scan direction).
23+
- Handling low-contrast or distorted barcodes.
24+
- Example configuration and practical tuning tips.
25+
26+
## Notes
27+
28+
- Serve via localhost/HTTPS to enable camera access.
29+
- See the repository root `README.md` for general instructions and API docs.

scenarios/scan-1D-Retail/ReadOneDRetail.json

Lines changed: 61 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
],
1111
"Name": "ReadOneDRetail",
1212
"MaxParallelTasks": 0,
13-
"Timeout": 500
13+
"Timeout": 1000
14+
},
15+
{
16+
"ImageROIProcessingNameArray": [
17+
"ROI_OneDRetail_ReadRate"
18+
],
19+
"Name": "ReadOneDRetail_ReadRate",
20+
"MaxParallelTasks": 0,
21+
"Timeout": 10000
1422
}
1523
],
1624
"TargetROIDefOptions": [
@@ -19,13 +27,19 @@
1927
"TaskSettingNameArray": [
2028
"Task_OneDRetail"
2129
]
30+
},
31+
{
32+
"Name": "ROI_OneDRetail_ReadRate",
33+
"TaskSettingNameArray": [
34+
"Task_OneDRetail_ReadRate"
35+
]
2236
}
2337
],
2438
"BarcodeReaderTaskSettingOptions": [
2539
{
2640
"Name": "Task_OneDRetail",
27-
"BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E"],
28-
"ExpectedBarcodesCount":0,
41+
"BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E", "BF_GS1_DATABAR"],
42+
"ExpectedBarcodesCount":1,
2943
"MaxThreadsInOneTask": 1,
3044
"SectionArray": [
3145
{
@@ -41,10 +55,6 @@
4155
},
4256
{
4357
"Mode": "LM_CONNECTED_BLOCKS"
44-
},
45-
{
46-
"Mode": "LM_NEURAL_NETWORK",
47-
"ModelNameArray": ["OneDLocalization"]
4858
}
4959
]
5060
}
@@ -58,10 +68,7 @@
5868
"Stage": "SST_DECODE_BARCODES",
5969
"DeblurModes":[
6070
{
61-
"Mode": "DM_BASED_ON_LOC_BIN"
62-
},
63-
{
64-
"Mode": "DM_THRESHOLD_BINARIZATION"
71+
"Mode": "DM_DIRECT_BINARIZATION"
6572
},
6673
{
6774
"Mode": "DM_NEURAL_NETWORK",
@@ -75,12 +82,55 @@
7582
]
7683
}
7784
]
85+
},
86+
{
87+
"Name": "Task_OneDRetail_ReadRate",
88+
"BarcodeFormatIds": ["BF_EAN_13", "BF_EAN_8", "BF_UPC_A", "BF_UPC_E", "BF_GS1_DATABAR"],
89+
"ExpectedBarcodesCount": 999,
90+
"MaxThreadsInOneTask": 1,
91+
"SectionArray": [
92+
{
93+
"Section": "ST_BARCODE_LOCALIZATION",
94+
"ImageParameterName": "ip",
95+
"StageArray": [
96+
{
97+
"Stage": "SST_LOCALIZE_CANDIDATE_BARCODES",
98+
"LocalizationModes": [
99+
{
100+
"Mode": "LM_SCAN_DIRECTLY",
101+
"ScanDirection": 2
102+
},
103+
{
104+
"Mode": "LM_CONNECTED_BLOCKS"
105+
},
106+
{
107+
"Mode": "LM_NEURAL_NETWORK"
108+
}
109+
]
110+
}
111+
]
112+
},
113+
{
114+
"Section": "ST_BARCODE_DECODING",
115+
"ImageParameterName": "ip",
116+
"StageArray": [
117+
{
118+
"Stage": "SST_DECODE_BARCODES",
119+
"DeblurModes": null
120+
}
121+
]
122+
}
123+
]
78124
}
79125
],
80126
"ImageParameterOptions": [
81127
{
82128
"ApplicableStages": [
83129
{
130+
"ImageScaleSetting": {
131+
"EdgeLengthThreshold": 100000,
132+
"ScaleType": "ST_SCALE_DOWN"
133+
},
84134
"Stage": "SST_SCALE_IMAGE"
85135
},
86136
{

scenarios/scan-1D-Retail/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1 class="barcode-scanner-title">
3434
templateFilePath:'./ReadOneDRetail.json',
3535
utilizedTemplateNames:{"single": "ReadOneDRetail",
3636
"multi_unique": "ReadOneDRetail",
37-
"image": "ReadOneDRetail"},
37+
"image": "ReadOneDRetail_ReadRate"},
3838
onInitReady: (components) => {
3939
// Set the scan region to a rectangle with percentage values by cameraEnhancer
4040
let region = {

scenarios/scan-any-codes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This sample demonstrates scanning a wide range of barcode formats (1D and 2D) us
55
## Included files
66

77
- `index.html` — Demo page (camera & image input) and UI.
8-
- `ReadAllBarcodeFormats.json` — Example configuration used by the sample (if present).
8+
- `ReadAllBarcodeFormats.json` — Example configuration used by the sample.
99

1010
## Quick start
1111

0 commit comments

Comments
 (0)