Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 12 additions & 35 deletions barcode-reader/general/avoid-incorrect-barcode-results.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
---
layout: default-layout
title: How to Avoid Incorrect Barcode Scan Results – FAQ
keywords: Dynamsoft Barcode Reader, FAQ, Troubleshooting / User Cases, avoid incorrect barcode results
description: Improve barcode decoding accuracy in Dynamsoft Barcode Reader by configuring minResultConfidence and minBarcodeTextLength.
title: How to Avoid Incorrect Barcode Results?
keywords: Dynamsoft Barcode Reader, FAQ, Troubleshooting / User Cases, avoid incorrect barcode results, minResultConfidence, minBarcodeTextLength
description: Improve barcode decoding accuracy in Dynamsoft Barcode Reader by configuring minResultConfidence and minBarcodeTextLength on SimplifiedBarcodeReaderSettings.
needAutoGenerateSidebar: false
---

# How to avoid incorrect barcode results?

- One method is to raise the value of [minResultConfidence](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html#minresultconfidence) of the `SimplifiedBarcodeReaderSettings` to a value of 50 or higher. It is set to 30 by default.
- If the issue has to do with the length of the text result, you can try setting a minimum length for the barcode text(s) that are returned by the SDK. By setting the [minBarcodeTextLength](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html#minbarcodetextlength) property of the `SimplifiedBarcodeReaderSettings`, the SDK can ignore results that are consistently coming out shorter than expected.
`SimplifiedBarcodeReaderSettings` — a sub-parameter of `SimplifiedCaptureVisionSettings` — exposes the same two filtering properties across every edition of Dynamsoft Barcode Reader (Server, Web, and Mobile), under each platform's own API reference, e.g. [C++](https://www.dynamsoft.com/barcode-reader/docs/server/programming/cplusplus/api-reference/simplified-barcode-reader-settings.html) and [JavaScript](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interfaces/simplified-barcode-reader-settings.html):

---

### CODE_128 decoding returns an extra byte?

When using DBR v11, you may notice that decoding a **CODE_128** barcode returns one extra byte at the end if you call `item.get_bytes()`.

**Cause**
By default, DBR includes the trailing check digit for CODE_128 in the decoded byte results. This is a known issue in versions 11.0.0 - 11.0.6000 and has been fixed in version 11.2.

**Solution**
Set `IncludeTrailingCheckDigit` to `0` in the `BarcodeFormatSpecification` for Code128. This will prevent the SDK from returning the trailing check digit.

**Example JSON Configuration**
- **minResultConfidence** – raise this value (default `30`) to require a higher confidence before a result is returned. 50 or higher is a good starting point if you're seeing unreliable reads.
- **minBarcodeTextLength** – set this to the minimum length your barcode text should be; results shorter than this are discarded. For example, if your barcode text should always be at least 10 characters long, set it to `10` so the SDK ignores shorter, likely-incorrect results.

```json
{
"BarcodeFormatSpecificationOptions": [
{
"Name": "bfs1",
"BarcodeFormatIds": [
"BF_CODE_128"
],
"MinResultConfidence": 30,
"RequireStartStopChars": 1,
"ReturnPartialBarcodeValue": 1,
"VerifyCheckDigit": 0,
"IncludeTrailingCheckDigit": 0
}
],
#...Other Settings
}
**Example (JavaScript):**
```javascript
let settings = await router.getSimplifiedSettings('ReadSingleBarcode');
settings.barcodeSettings.minResultConfidence = 40; //setting confidence
settings.barcodeSettings.minBarcodeTextLength = 5; //setting barcodeTextLength
await router.updateSettings('ReadSingleBarcode', settings);
```
11 changes: 0 additions & 11 deletions barcode-reader/general/avoid-incorrect-results.md

This file was deleted.

38 changes: 38 additions & 0 deletions barcode-reader/general/code-128-extra-trailing-byte.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: default-layout
title: CODE_128 Decoding Returns an Extra Byte? – FAQ
keywords: Dynamsoft Barcode Reader, FAQ, Troubleshooting / User Cases, CODE_128, IncludeTrailingCheckDigit
description: Fix Dynamsoft Barcode Reader v11 CODE_128 decoding returning an extra trailing check digit byte by setting IncludeTrailingCheckDigit to 0.
needAutoGenerateSidebar: false
---

# CODE_128 decoding returns an extra byte?

When using DBR v11, you may notice that decoding a **CODE_128** barcode returns one extra byte at the end if you call `item.get_bytes()`.

**Cause**
By default, DBR includes the trailing check digit for CODE_128 in the decoded byte results. This is a known issue in versions 11.0.0 - 11.0.6000 and has been fixed in version 11.2.

**Solution**
Set `IncludeTrailingCheckDigit` to `0` in the `BarcodeFormatSpecification` for Code128. This will prevent the SDK from returning the trailing check digit.

**Example JSON Configuration**

```json
{
"BarcodeFormatSpecificationOptions": [
{
"Name": "bfs1",
"BarcodeFormatIds": [
"BF_CODE_128"
],
"MinResultConfidence": 30,
"RequireStartStopChars": 1,
"ReturnPartialBarcodeValue": 1,
"VerifyCheckDigit": 0,
"IncludeTrailingCheckDigit": 0
}
],
#...Other Settings
}
```
2 changes: 1 addition & 1 deletion barcode-reader/general/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please use the links below to find answers to common questions and configuration

- [Does Dynamsoft Barcode Reader (DBR) support PDF?](dbr-supports-pdf.html)
- [How to avoid incorrect barcode results?](avoid-incorrect-barcode-results.html)
- [How to filter incorrect results with the barcode result length?](avoid-incorrect-results.html)
- [CODE_128 decoding returns an extra byte?](code-128-extra-trailing-byte.html)
- [Check Current Version](check-current-version.html)
- [Different Editions of DBR](different-editions-of-dbr.html)
- [How to scan US driver's license?](scan-us-drivers-license.html)
Expand Down
11 changes: 0 additions & 11 deletions barcode-reader/server/configuration/avoid-incorrect-results.md

This file was deleted.

2 changes: 1 addition & 1 deletion barcode-reader/server/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ noTitleIndex: true

# Configuration Index

- [How to filter incorrect results with the barcode result length?](avoid-incorrect-results.html)
- [How to avoid incorrect barcode results?](../../general/avoid-incorrect-barcode-results.html)
- [How to create custom settings template?](custom-settings-template.html)
- [How to enable DPM?](how-to-enable-dpm.html)
- [How can I sort the barcodes of my image in reading order?](sort-barcodes-image.html)
Expand Down
2 changes: 1 addition & 1 deletion barcode-reader/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Welcome to the FAQ for Dynamsoft Barcode Reader on server platforms. Use the lin

## Configuration

- [Avoid Incorrect Results](configuration/avoid-incorrect-results.html)
- [Avoid Incorrect Results](../general/avoid-incorrect-barcode-results.html)
- [Custom Settings Template](configuration/custom-settings-template.html)
- [How to Enable DPM?](configuration/how-to-enable-dpm.html)
- [Non-English Characters](configuration/non-english-characters.html)
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion barcode-reader/web/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ noTitleIndex: true

# Configuration Index

- [How to avoid incorrect barcode results?](avoid-incorrect-barcode-results.html)
- [How to avoid incorrect barcode results?](../../general/avoid-incorrect-barcode-results.html)
- [Do we have to call loadWasm proactively?](call-loadWasm-proactively.html)
- [How to change the domain binding of a product key?](change-domain-binding-of-product-key.html)
- [Formats supported for existing files](formats-supported-for-existing-files.html)
Expand Down
2 changes: 1 addition & 1 deletion barcode-reader/web/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Welcome! Browse the sections below for answers to common questions, configuratio

## Configuration

- [How to avoid incorrect barcode results?](configuration/avoid-incorrect-barcode-results.html)
- [How to avoid incorrect barcode results?](../general/avoid-incorrect-barcode-results.html)
- [Do we have to call loadWasm proactively?](configuration/call-loadWasm-proactively.html)
- [How to change the domain binding of a product key?](configuration/change-domain-binding-of-product-key.html)
- [Formats supported for existing files](configuration/formats-supported-for-existing-files.html)
Expand Down