diff --git a/barcode-reader/general/avoid-incorrect-barcode-results.md b/barcode-reader/general/avoid-incorrect-barcode-results.md index c6943ce..2d8ac3c 100644 --- a/barcode-reader/general/avoid-incorrect-barcode-results.md +++ b/barcode-reader/general/avoid-incorrect-barcode-results.md @@ -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); ``` diff --git a/barcode-reader/general/avoid-incorrect-results.md b/barcode-reader/general/avoid-incorrect-results.md deleted file mode 100644 index 10c10da..0000000 --- a/barcode-reader/general/avoid-incorrect-results.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default-layout -title: How to filter incorrect results with the barcode result length in DBR SDK? -keywords: Dynamsoft Barcode Reader, FAQ, DBR Introduction, General, incorrect results -description: How to filter incorrect results with the barcode result length? -needAutoGenerateSidebar: false ---- - -# How to filter out unwanted barcodes using the result length? - -One way to filter results is to set the [minBarcodeTextLength](https://www.dynamsoft.com/barcode-reader/docs/server/programming/cplusplus/api-reference/simplified-barcode-reader-settings.html#:~:text=int%20minResultConfidence%3B-,int%20minBarcodeTextLength%3B,-char%20barcodeTextRegExPattern%5B) in [SimplifiedBarcodeReaderSettings](https://www.dynamsoft.com/barcode-reader/docs/server/programming/cplusplus/api-reference/simplified-barcode-reader-settings.html#:~:text=SimplifiedBarcodeReaderSettings-,SimplifiedBarcodeReaderSettings,-The%20SimplifiedBarcodeReaderSettings%20struct) of [SimplifiedCaptureVisionSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/structs/simplified-capture-vision-settings.html?product=dbr&repoType=server) to the correct length that the barcode results should be. Say that the barcode results should at least be 10 characters long, and the results are sometimes coming out with just 6 or 7 characters. By setting the minBarcodeTextLength to 10, the SDK will ignore results that are shorter than 10 characters. diff --git a/barcode-reader/general/code-128-extra-trailing-byte.md b/barcode-reader/general/code-128-extra-trailing-byte.md new file mode 100644 index 0000000..1ff9318 --- /dev/null +++ b/barcode-reader/general/code-128-extra-trailing-byte.md @@ -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 +} +``` diff --git a/barcode-reader/general/index.md b/barcode-reader/general/index.md index 8667ce8..c647001 100644 --- a/barcode-reader/general/index.md +++ b/barcode-reader/general/index.md @@ -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) diff --git a/barcode-reader/server/configuration/avoid-incorrect-results.md b/barcode-reader/server/configuration/avoid-incorrect-results.md deleted file mode 100644 index d19f395..0000000 --- a/barcode-reader/server/configuration/avoid-incorrect-results.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default-layout -title: How to filter incorrect results with the barcode result length in DBR Server SDK? -keywords: Dynamsoft Barcode Reader, FAQ, DBR Introduction, General, incorrect results -description: How to filter incorrect results with the barcode result length? -needAutoGenerateSidebar: false ---- - -# How to filter incorrect results with the barcode result length? - -To filter out incorrect results, set the [minBarcodeTextLength](https://www.dynamsoft.com/barcode-reader/docs/server/programming/cplusplus/api-reference/simplified-barcode-reader-settings.html#:~:text=int%20minResultConfidence%3B-,int%20minBarcodeTextLength%3B,-char%20barcodeTextRegExPattern%5B) in [SimplifiedBarcodeReaderSettings](https://www.dynamsoft.com/barcode-reader/docs/server/programming/cplusplus/api-reference/simplified-barcode-reader-settings.html#:~:text=SimplifiedBarcodeReaderSettings-,SimplifiedBarcodeReaderSettings,-The%20SimplifiedBarcodeReaderSettings%20struct) of [SimplifiedCaptureVisionSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/cplusplus/api-reference/capture-vision-router/structs/simplified-capture-vision-settings.html?product=dbr&repoType=server) to the correct length that the barcode results should be. Say that the barcode results should at least be 10 characters long, and the results are sometimes coming out with just 6 or 7 characters. By setting the minBarcodeTextLength to 10, the SDK will ignore results that are shorter than 10 characters. diff --git a/barcode-reader/server/configuration/index.md b/barcode-reader/server/configuration/index.md index da3334f..c22a80c 100644 --- a/barcode-reader/server/configuration/index.md +++ b/barcode-reader/server/configuration/index.md @@ -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) diff --git a/barcode-reader/server/index.md b/barcode-reader/server/index.md index 0e8c119..04e4e46 100644 --- a/barcode-reader/server/index.md +++ b/barcode-reader/server/index.md @@ -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) diff --git a/barcode-reader/web/configuration/avoid-incorrect-barcode-results.md b/barcode-reader/web/configuration/avoid-incorrect-barcode-results.md deleted file mode 100644 index 6954fcf..0000000 --- a/barcode-reader/web/configuration/avoid-incorrect-barcode-results.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: default-layout -title: How to Avoid Wrong Barcode Results in Web Apps - Dynamsoft -keywords: Dynamsoft Barcode Reader, FAQ, JavaScript, Troubleshooting / User Cases, avoid incorrect barcode results -description: Avoid inaccurate barcode scans in Dynamsoft Barcode Reader Web by configuring result confidence thresholds and minimum barcode text length. -needAutoGenerateSidebar: false ---- - -# How to avoid incorrect barcode results? - -## Version 10 and above -- 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` interface of `SimplifiedCaptureVisionSettings`. 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` interface of `SimplifiedCaptureVisionSettings`, the SDK can ignore results that are consistently coming out shorter than expected. It is set to `0` by default. - -```javascript - let settings = await router.getSimplifiedSettings('ReadSingleBarcode'); - settings.barcodeSettings.minResultConfidence = 40; //setting confidence - settings.barcodeSettings.minBarcodeTextLength = 5; //setting barcodeTextLength - await router.updateSettings('ReadSingleBarcode', settings); -``` - -## Version 9 -- One method is to raise the value of [minResultConfidence](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/interface/RuntimeSettings.html#minresultconfidence) of the `RuntimeSettings` 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/v9/web/programming/javascript/api-reference/interface/RuntimeSettings.html#minbarcodetextlength) property of the `RuntimeSettings`, the SDK can ignore results that are consistently coming out shorter than expected. diff --git a/barcode-reader/web/configuration/index.md b/barcode-reader/web/configuration/index.md index 4f013b4..6cf1e2a 100644 --- a/barcode-reader/web/configuration/index.md +++ b/barcode-reader/web/configuration/index.md @@ -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) diff --git a/barcode-reader/web/index.md b/barcode-reader/web/index.md index 6c75235..b7918f4 100644 --- a/barcode-reader/web/index.md +++ b/barcode-reader/web/index.md @@ -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)