diff --git a/_config.yml b/_config.yml index 6c47793e..48b708cc 100644 --- a/_config.yml +++ b/_config.yml @@ -14,11 +14,6 @@ introduction: /barcode-reader/docs/core/introduction/ programming: /barcode-reader/docs/core/programming/ features: /barcode-reader/docs/core/programming/features/ -parameters: /barcode-reader/docs/core/parameters/ -parameters_reference: /barcode-reader/docs/core/parameters/reference/ -image_parameters: /barcode-reader/docs/core/parameters/reference/image-parameter/ -scenario_settings: /barcode-reader/docs/core/parameters/scenario-settings/ - license_activation: /barcode-reader/docs/core/license-activation/ release_notes: /barcode-reader/docs/core/release-notes/ performance: /barcode-reader/docs/core/performance/ diff --git a/index.md b/index.md index a42d6764..3f6f51bd 100644 --- a/index.md +++ b/index.md @@ -1,6 +1,6 @@ --- layout: home-page -title: Dynamsoft Barcode Reader SDK Documentation +title: Dynamsoft Barcode Reader SDK – Documentation Overview keywords: dynamsoft barcode reader, dbr, documentation breadcrumbText: HomePage description: Dynamsoft Barcode Reader SDK Documentation Homepage diff --git a/introduction/how-to-guide/assets/check-if-the-barcode-image-is-clear-enough-for-recognition/barcode-module-width.png b/introduction/how-to-guide/assets/check-if-the-barcode-image-is-clear-enough-for-recognition/barcode-module-width.png deleted file mode 100644 index c6b8b1de..00000000 Binary files a/introduction/how-to-guide/assets/check-if-the-barcode-image-is-clear-enough-for-recognition/barcode-module-width.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/enable-scale-up-for-barcode-recognition/scale-up-image.png b/introduction/how-to-guide/assets/enable-scale-up-for-barcode-recognition/scale-up-image.png deleted file mode 100644 index 889f6f98..00000000 Binary files a/introduction/how-to-guide/assets/enable-scale-up-for-barcode-recognition/scale-up-image.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/copy-button.png b/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/copy-button.png deleted file mode 100644 index 51b1239f..00000000 Binary files a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/copy-button.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/online-demo.png b/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/online-demo.png deleted file mode 100644 index 9cdc8a10..00000000 Binary files a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/online-demo.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/settings-panel.png b/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/settings-panel.png deleted file mode 100644 index 8faff6c8..00000000 Binary files a/introduction/how-to-guide/assets/generate-a-custom-barcode-reading-template/settings-panel.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/get-additional-barcode-information/1d-angle.png b/introduction/how-to-guide/assets/get-additional-barcode-information/1d-angle.png deleted file mode 100644 index e1416c66..00000000 Binary files a/introduction/how-to-guide/assets/get-additional-barcode-information/1d-angle.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/get-additional-barcode-information/aztec-angle.png b/introduction/how-to-guide/assets/get-additional-barcode-information/aztec-angle.png deleted file mode 100644 index ad01be9b..00000000 Binary files a/introduction/how-to-guide/assets/get-additional-barcode-information/aztec-angle.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/get-additional-barcode-information/dm-angle.png b/introduction/how-to-guide/assets/get-additional-barcode-information/dm-angle.png deleted file mode 100644 index afeeefa5..00000000 Binary files a/introduction/how-to-guide/assets/get-additional-barcode-information/dm-angle.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/get-additional-barcode-information/maxicode-angle.png b/introduction/how-to-guide/assets/get-additional-barcode-information/maxicode-angle.png deleted file mode 100644 index 7da56b0e..00000000 Binary files a/introduction/how-to-guide/assets/get-additional-barcode-information/maxicode-angle.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/get-additional-barcode-information/qr-angle.png b/introduction/how-to-guide/assets/get-additional-barcode-information/qr-angle.png deleted file mode 100644 index 01c019ae..00000000 Binary files a/introduction/how-to-guide/assets/get-additional-barcode-information/qr-angle.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode-2.png b/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode-2.png deleted file mode 100644 index fa7480d5..00000000 Binary files a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode-2.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode.png b/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode.png deleted file mode 100644 index fa7480d5..00000000 Binary files a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/color-barcode.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/dark-background-barcode.png b/introduction/how-to-guide/assets/read-barcodes-with-different-colors/dark-background-barcode.png deleted file mode 100644 index b720de0d..00000000 Binary files a/introduction/how-to-guide/assets/read-barcodes-with-different-colors/dark-background-barcode.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/set-custom-area-for-accompanying-texts/accompanying-text-zone.png b/introduction/how-to-guide/assets/set-custom-area-for-accompanying-texts/accompanying-text-zone.png deleted file mode 100644 index 4e81ae1e..00000000 Binary files a/introduction/how-to-guide/assets/set-custom-area-for-accompanying-texts/accompanying-text-zone.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-explanation.png b/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-explanation.png deleted file mode 100644 index a8590c55..00000000 Binary files a/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-explanation.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-sample.png b/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-sample.png deleted file mode 100644 index a2fc7a77..00000000 Binary files a/introduction/how-to-guide/assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-sample.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/test-batch-scan-performance/daemon-execution-interface.png b/introduction/how-to-guide/assets/test-batch-scan-performance/daemon-execution-interface.png deleted file mode 100644 index c32c9a7f..00000000 Binary files a/introduction/how-to-guide/assets/test-batch-scan-performance/daemon-execution-interface.png and /dev/null differ diff --git a/introduction/how-to-guide/assets/test-batch-scan-performance/startup-interface.png b/introduction/how-to-guide/assets/test-batch-scan-performance/startup-interface.png deleted file mode 100644 index 97a1f75a..00000000 Binary files a/introduction/how-to-guide/assets/test-batch-scan-performance/startup-interface.png and /dev/null differ diff --git a/introduction/how-to-guide/check-if-the-barcode-image-is-clear-enough-for-recognition.md b/introduction/how-to-guide/check-if-the-barcode-image-is-clear-enough-for-recognition.md deleted file mode 100644 index 51d27560..00000000 --- a/introduction/how-to-guide/check-if-the-barcode-image-is-clear-enough-for-recognition.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -layout: default-layout -title: Check If the Barcode Image Is Clear Enough for Recognition - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to check if the barcode image is clear enough for recognition. -keywords: image resolution, barcode module, clear image, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/check-if-the-barcode-image-is-clear-enough-for-recognition.html ---- - - -# How-to Guides - Check If the Barcode Image Is Clear Enough for Recognition - -We often receive questions from customers as to why Dynamsoft Barcode Reader SDK is unable to decode their barcode, and the answer is often that the resolution of the original image is too low. Then what is the right resolution for a barcode image? - -The resolution alone does not decide the barcode readability. What matters is the barcode module size. - -## Module size for a linear barcode - - A linear barcode is made up of parallel bars and spaces spacings. Module size is defined by the X-dimension -- the width of the narrowest bar, as shown in the image below: - -![Clear Barcode Example Image][1] - - -The recommended barcode module width for linear barcode types is at least **2 pixels**. - - -[1]: assets/check-if-the-barcode-image-is-clear-enough-for-recognition/barcode-module-width.png diff --git a/introduction/how-to-guide/decode-dpm-data-matrix.md b/introduction/how-to-guide/decode-dpm-data-matrix.md deleted file mode 100644 index 21fe12dd..00000000 --- a/introduction/how-to-guide/decode-dpm-data-matrix.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -layout: default-layout -title: Decode DPM Data Matrix - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to decode DPM Data Matrix. -keywords: dmp, decode, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/decode-dpm-data-matrix.html ---- - -# How-to Guides - Decode DPM Data Matrix - - -Since version 7.2 of Dynamsoft Barcode Reader SDK, direct part mark (DPM) Data Matrix scanning is supported. To decode DPM codes, some particular settings are required: - -The value `DPMCRM_GENERAL` needs to be set for the parameter [`PublicRuntimeSettings`]({{ site.structs }}PublicRuntimeSettings.html)->[`FurtherModes`]({{ site.structs }}FurtherModes.html)->[`DPMCodeReadingModes`]({{ site.structs }}FurtherModes.html#dpmcodereadingmodes). - - -The value `LM_STATISTICS_MARKS` needs to be set for the parameter [`PublicRuntimeSettings`]({{ site.structs }}PublicRuntimeSettings.html)->[`LocalizationModes`]({{ site.structs }}PublicRuntimeSettings.html#localizationmodes). - - -For more information about decoding DPM, see [DPM Decoding]({{ site.scenario_settings }}dpm-decoding.html). - - -The following code shows how to set the runtime settings for DPM decoding: - -```cpp -char sError[512]; -TextResultArray* paryResult = NULL; -CBarcodeReader reader; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -reader.InitLicense(""); -reader.GetRuntimeSettings(runtimeSettings); -//turn on the DPM mode -runtimeSettings->furtherModes.dpmCodeReadingModes[0] = DPMCRM_GENERAL; -runtimeSettings->localizationModes[0] = LM_STATISTICS_MARKS; -//update the runtime settings -reader.UpdateRuntimeSettings(runtimeSettings, sError, 512); -reader.DecodeFile("", ""); -reader.GetAllTextResults(&paryResult); -CBarcodeReader::FreeTextResults(&paryResult); -``` - - diff --git a/introduction/how-to-guide/enable-scale-up-for-barcode-recognition.md b/introduction/how-to-guide/enable-scale-up-for-barcode-recognition.md deleted file mode 100644 index f75bee60..00000000 --- a/introduction/how-to-guide/enable-scale-up-for-barcode-recognition.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -layout: default-layout -title: Enable Scale Up for Barcode Recognition - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to enable scale up for barcode recognition. -keywords: scale up, small image decode, ScaleUpModes, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/enable-scale-up-for-barcode-recognition.html ---- - -# How-to Guides - Enable Scale Up for Barcode Recognition - -For some barcodes with small module size, Dynamsoft Barcode Reader SDK will automatically enlarge the barcode to a proper size before recognition. - -Since version 7.3, Dynamsoft Barcode Reader SDK provides [`PublicRuntimeSettings`]({{ site.structs }}PublicRuntimeSettings.html)->[`ScaleUpModes`]({{ site.structs }}PublicRuntimeSettings.html#scaleupmodes) with arguments - `ModuleSizeThreshold`, `AcuteAngleWithXThreshold` and `TargetModuleSize` APIs which allow you to set the custom rules for scaling up. To enable it, you need to set [`PublicRuntimeSettings`]({{ site.structs }}PublicRuntimeSettings.html)->[`ScaleUpModes`]({{ site.structs }}PublicRuntimeSettings.html#scaleupmodes) to `SUM_LINEAR_INTERPOLATION` or `SUM_NEAREST_NEIGHBOUR_INTERPOLATION`, then set the rest parameters. - -If the module size of the barcode < ModuleSizeThreshold and the acute angle with X of the barcode > AcuteAngleWithXThreshold, the barcode will be enlarged to N times (N=1,2,3...) till N * modulesize >= TargetModuleSize. - -**Example** - -Condition: `ModuleSizeThreshold` = 4, `AcuteAngleWithXThreshold` = 30, `TargetModuleSize` = 4 - -![Scale Up Example Image]({{site.introduction}}how-to-guide/assets/enable-scale-up-for-barcode-recognition/scale-up-image.png) - -Result: - -The module size of the barcode in the image is 2, which is smaller than ModuleSizeThreshold, and the acute angle is larger than AcuteAngleWithXThreshold, so our library will perform scaling up operation. After scaling up, the barcode is enlarged to 2 times since 2 * modulesize >= TargetModuleSize. - -For more information about enabling scale up mode, please see [`ScaleUpModes`]({{ site.parameters_reference }}scale-up-modes.html#scaleupmodes) and [How to Set Scale Up Modes]({{ site.scenario_settings }}how-to-set-scaleup-modes.html). diff --git a/introduction/how-to-guide/filter-out-unwanted-barcode-results.md b/introduction/how-to-guide/filter-out-unwanted-barcode-results.md deleted file mode 100644 index 88825ee9..00000000 --- a/introduction/how-to-guide/filter-out-unwanted-barcode-results.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -layout: default-layout -title: Filter Out Unwanted Barcode Result - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to filter out unwanted barcode results. -keywords: filter, decode result, barcode confidence, result length, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/filter-out-unwanted-barcode-results.html ---- - - -# How-to Guides - Filter Out Unwanted Barcode Result - -Dynamsoft Barcode Reader SDK is able to read multiple barcodes at once and return results of all the decoded barcodes. However, you may not want all the results. For example, you may need only the results of a specific barcode format, or you may need only the barcodes with a certain length (number of barcode data bytes). The SDK provides settings to help you filter out the barcode results by barcode formats, confidence, text length, rotation angle, regular expression and so on. - - -Filtering out the barcode results based on the barcode formats is shown in [Barcode Format and Expected Barcode Counts]({{ site.scenario_settings }}barcode-format-and-expected-barcode-counts.html). - - -Filtering out the barcode results based on confidence, text length or more optional conditions is shown in [Decode Result]({{ site.scenario_settings }}decode-result.html). - - -Following part shows how to filter out the unwanted barcode results based on the barcode confidence and barcode text length as examples. - -## Filtering Using Barcode Confidence - -The barcode confidence means the probability that the barcode result is recognized correctly. You can use `minResultConfidence` to filter out the results with low confidence. - - -```cpp -char sError[512]; -TextResultArray* paryResult = NULL; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -CBarcodeReader* reader = new CBarcodeReader(); -//Initialize license prior to any decoding -//Replace "" with your own license -reader->InitLicense(""); - -//Obtain the barcode results with confidence above 35 -reader->GetRuntimeSettings(runtimeSettings); -runtimeSettings->minResultConfidence = 35; //It is recommended to set the confidence above 35 -reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); - -//Replace "" with your own file path -reader->DecodeFile("", ""); -// If succeeds -reader->GetAllTextResults(&paryResult); -CBarcodeReader::FreeTextResults(&paryResult); -delete runtimeSettings; -delete reader; -``` - - -## Filtering Using Barcode Result Length - -The barcode length is calculated in bytes. The length of the barcode text does not necessarily mean the actual length of the barcode bytes. You can use `minBarcodeTextLength` to filter out some invalid or unwanted results. - - -```cpp -char sError[512]; -TextResultArray* paryResult = NULL; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -CBarcodeReader* reader = new CBarcodeReader(); -//Initialize license prior to any decoding -//Replace "Put your license key here" with your own license -reader->InitLicense("Put your license key here"); - -//Decode the barcodes with its length longer than 10 bytes -reader->GetRuntimeSettings(runtimeSettings); -runtimeSettings->minBarcodeTextLength = 10; -reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); - -//Replace "Put the path of your file here" with your own file path -reader->DecodeFile("Put your file path here", ""); -// If succeeds -reader->GetAllTextResults(&paryResult); -CBarcodeReader::FreeTextResults(&paryResult); -delete runtimeSettings; -delete reader; -``` - diff --git a/introduction/how-to-guide/generate-a-custom-barcode-reading-template.md b/introduction/how-to-guide/generate-a-custom-barcode-reading-template.md deleted file mode 100644 index 5fef3b9a..00000000 --- a/introduction/how-to-guide/generate-a-custom-barcode-reading-template.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -layout: default-layout -title: Generate a Custom Barcode Reading Template - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to generate a custom barcode reading template. -keywords: custom settings, template, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/generate-a-custom-barcode-reading-template.html ---- - - -# How-to Guides - Generate a Custom Barcode Reading Template - - -Starting from Dynamsoft Barcode Reader version 6, it is recommended to set all barcode reading configurations in the template (*.json). This article will talk about how to customize your own template based on our standard templates on our online demo. - - -1. Open our [Online Demo](https://demo6.dynamsoft.com/barcode-reader/): - ![Online Demo Example Image][1] - -2. Modify the settings on the left panel: - ![Setting Panel Example Image][2] - -3. At the bottom of the panel, switch to JSON tab and click the copy button: - ![Output JSON Example Image][3] - -4. Save the string as a .json file and use [`InitRuntimeSettingsWithFile`]({{ site.cpp_methods }}parameter-and-runtime-settings-advanced.html#initruntimesettingswithfile) method to update the barcode reading settings. - - - -For more information about using template, please see [How to Set Parameters]({{ site.scenario_settings }}how-to-set-parameters.html). - - - -[1]: assets/generate-a-custom-barcode-reading-template/online-demo.png - -[2]: assets/generate-a-custom-barcode-reading-template/settings-panel.png - -[3]: assets/generate-a-custom-barcode-reading-template/copy-button.png diff --git a/introduction/how-to-guide/get-additional-barcode-information.md b/introduction/how-to-guide/get-additional-barcode-information.md deleted file mode 100644 index c500d26f..00000000 --- a/introduction/how-to-guide/get-additional-barcode-information.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -layout: default-layout -title: Get Additional Barcode Information - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to get additional barcode information. -keywords: additional information, angle, confidence, decode result, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/get-additional-barcode-information.html ---- - - -# How-to Guides - Get Additional Barcode Information - -Dynamsoft Barcode Reader APIs for you to get the additional barcode information besides barcode value. The result is stored in the struct [`LocalizationResult`]({{ site.structs }}LocalizationResult.html) and struct [`ExtendedResult`]({{ site.structs }}ExtendedResult.html). - - -This article offers two examples about how to get barcode rotation angle and how to get barcode confidence. - - -To learn more about what additional barcode information you can get please see struct [`LocalizationResult`]({{ site.structs }}LocalizationResult.html) and struct [`ExtendedResult`]({{ site.structs }}ExtendedResult.html). - - -## Get Barcode Rotation Angle - -Dynamsoft Barcode Reader SDK is able to detect barcodes at all angles. The SDK is also able to return the angles of the barcodes decoded. The result is stored in the struct [`LocalizationResult`]({{ site.structs }}LocalizationResult.html). - -The following illustrations will show how the angle is calculated for different barcode types: - -1. OneD Barcode - ![OneD Barcode Rotation Angle][1] - -2. QR Code - ![QR Code Rotation Angle][2] - -3. Data Matrix - ![Data Matrix Rotation Angle][3] - -4. Aztec - ![Aztec Rotation Angle][4] - -5. Maxicode - ![Maxicode Rotation Angle][5] - - - -The following code snippet shows how to get the rotation/skew angles of the barcodes decoded by the SDK: -```cpp -TextResultArray* paryResult = NULL; -CBarcodeReader reader; -reader.InitLicense("put your license key here"); -reader.DecodeFile("put your image file full path here", ""); -reader.GetAllTextResults(&paryResult); -printf("%d total barcodes found. \r\n", paryResult->resultsCount); -for (int iIndex = 0; iIndex < paryResult->resultsCount; iIndex++) -{ -printf("Result %d\r\n", iIndex + 1); -printf("Barcode Angle:%d \n", paryResult->results[iIndex]->localizationResult->angle); -} -CBarcodeReader::FreeTextResults(&paryResult); -``` - - - - -## Get Barcode Confidence - -The score of recognition confidence could measure the reliability of a recognized result. The higher the score, the more precise the results are. We could obtain confidence result from struct [`ExtendedResult`]({{ site.structs }}ExtendedResult.html). The following code snippet shows how to get the confidence of the barcodes decoded by the SDK: - - -```cpp -TextResultArray* paryResult = NULL; -CBarcodeReader reader; -reader.InitLicense("put your license key here"); -reader.DecodeFile("put your image file full path here", ""); -reader.GetAllTextResults(&paryResult); -printf("%d total barcodes found. \r\n", paryResult->resultsCount); -for (int iIndex = 0; iIndex < paryResult->resultsCount; iIndex++) -{ -printf("Result %d\r\n", iIndex + 1); -printf("Barcode Confidence : %d \r", paryResult->results[iIndex]->results[0]->confidence); -CBarcodeReader::FreeTextResults(&paryResult); -``` - - - -[1]: assets/get-additional-barcode-information/1d-angle.png - -[2]: assets/get-additional-barcode-information/qr-angle.png - -[3]: assets/get-additional-barcode-information/dm-angle.png - -[4]: assets/get-additional-barcode-information/aztec-angle.png - -[5]: assets/get-additional-barcode-information/maxicode-angle.png diff --git a/introduction/how-to-guide/get-detailed-barcode-information.md b/introduction/how-to-guide/get-detailed-barcode-information.md deleted file mode 100644 index 740d8635..00000000 --- a/introduction/how-to-guide/get-detailed-barcode-information.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -layout: default-layout -title: Dynamsoft Barcode Reader How-to Guides - Get Detailed Barcode Information -description: Find out how to get the detailed barcode information like checksum digit, start/stop characters, error correction level, etc. -keywords: additional information, angle, confidence, decode result, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/get-detailed-barcode-information.html ---- - - -# How-to Guides - Get Detailed Barcode Information - -The Dynamsoft Barcode Reader SDK provides APIs for you to get the detailed barcode information like checksum digit, start/stop characters, error correction level, etc. To learn more about what information you can get, see the following API links: - -- [OneDCodeDetails]({{ site.structs }}OneDCodeDetails.html) -- [QRCodeDetails]({{ site.structs }}QRCodeDetails.html) -- [PDF417Details]({{ site.structs }}PDF417Details.html) -- [DataMatrixDetails]({{ site.structs }}DataMatrixDetails.html) -- [AztecDetails]({{ site.structs }}AztecDetails.html) - - - -Here we take QR Code as example and show how to get the version and model of a QR Code. - - -## What is the Version of a QR Code? - -| QRCode Version | Modules | -|----------------|---------| -| Version 1 | 21 x 21 | -| Version 2 | 25 x 25 | -| ... | ... | -| Version N | (17 + N x 4) x (17 + N x 4) | -| Version 40 | 177 x 177 | - - - -## What is the Model of a QR Code? - -| QRCode Model | Description | -|--------------|---------| -| Model 1 | The original QR Code. It is a code capable of coding 1,167 numerals with its maximum version being 14 (73 x 73 modules). | -| Model 2 | Created by improving Model 1 so that this code can be read smoothly even if it is distorted in some way. This code can encode up to 7,089 numerals with its maximum version being 40 (177 x 177 modules). Today, the term QRCode usually refers to QRCode Model 2. | - -## Code Snippet for Getting Detailed Barcode Information - -```cpp -int iRet = -1; -int iLicMsg = -1; -TextResultArray* paryResult = NULL; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -// Initialize license prior to any decoding -CBarcodeReader reader; -char sError[512]; -iLicMsg = reader.InitLicense("f0068MgA4o***"); -reader.GetRuntimeSettings(runtimeSettings); -runtimeSettings->barcodeFormatIds = BF_QR_CODE; -reader.UpdateRuntimeSettings(runtimeSettings, sError, 512); -//If error occurs to the license initialization -if (iLicMsg != DBR_OK) -{ - printf("Failed to initialize the license successfully: %d\r\n%s\r\n", iLicMsg, DBR_GetErrorString(iLicMsg)); - return iLicMsg; -} -// Start decoding -iRet = reader.DecodeFile("", ""); -// If error occurs -if (iRet != DBR_OK) -{ - printf("Failed to read barcode: %d\r\n%s\r\n", iRet, DBR_GetErrorString(iRet)); - return iRet; -} -// If succeeds -reader.GetAllTextResults(&paryResult); -for (int iIndex = 0; iIndex < paryResult->resultsCount; iIndex++) -{ - QRCodeDetails* qrd = (QRCodeDetails*)paryResult->results[iIndex]->detailedResult; - printf("QRCode Model:%d \r\n", qrd->model); - printf("QRCode Version: %d \r\n", qrd->version); - printf("BarcodeFormat: %s\r\n", paryResult->results[iIndex]->barcodeFormatString); - printf("Text read: %s\r\n", paryResult->results[iIndex]->barcodeText); -} -// Finally release BarcodeResultArray -CBarcodeReader::FreeTextResults(&paryResult); -return 0; -``` - - diff --git a/introduction/how-to-guide/get-intermediate-results.md b/introduction/how-to-guide/get-intermediate-results.md deleted file mode 100644 index 807df254..00000000 --- a/introduction/how-to-guide/get-intermediate-results.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -layout: default-layout -title: Get Intermediate Results - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to get Intermediate Results. -keywords: intermediate results, IntermediateResult, IntermediateResultType, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/get-intermediate-results.html ---- - - -# How-to Guides - Get Intermediate Results - -Apart from getting the results like barcode type, value, location, Dynamsoft Barcode Reader also provides APIs for you to get the intermediate results like original image, transformed grayscale image, binarized image, text zone, etc. for further analysis. To learn more about what intermediate results you can get, see enum [`IntermediateResultType`]({{ site.enumerations }}result-enums.html#intermediateresulttype). - - - -**Note**: You will need a separate license for the intermediate results such as transformed grayscale image, binarized image, and text zone. Getting the original image of the intermediate result doesn't require a separate license. The original image is the one that Dynamsoft Barcode Reader SDK uses to do the barcode reading. If the SDK fails to recognize the barcodes using the original image, try [`different settings`]({{ site.scenario_settings }}how-to-set-parameters.html) or [contact Dynamsoft Support](https://www.dynamsoft.com/company/customer-service/#contact) for help. - - - -Here we will show how to get the original image and save it to your file system: - -```cpp - int iRet = -1; - hBarcode = DBR_CreateInstance(); - DBR_InitLicense(hBarcode, "t0068MgAAAGotN***"); // Set the trial license - - DBR_GetRuntimeSettings(hBarcode,&runtimeSettings); - runtimeSettings.intermediateResultTypes = IRT_ORIGINAL_IMAGE; - // Here we save it to the file system. You can also save it to memory according to your needs. - runtimeSettings.intermediateResultSavingMode = IRSM_FILESYSTEM; - iRet = DBR_UpdateRuntimeSettings(hBarcode,&runtimeSettings,szErrorMsg,256); - // Set the folder path which stores the intermediate result (original image). Please make sure you have write permission to this folder. - iRet = DBR_SetModeArgument(hBarcode, "IntermediateResultSavingMode", 0, "FolderPath", "D:\DBRLogs", szErrorMsg, 256); - if (iRet != DBR_OK) // If error occurs - { - printf("Error code: %d. Error message: %s\n", iRet, szErrorMsg); - return -1; - } - DBR_DecodeFile(hBarcode, "",""); - IntermediateResultArray* pResults; - DBR_GetIntermediateResults(hBarcode, &pResults); - - DBR_DestroyInstance(hBarcode); -``` - - -To learn more about intermediate result, please see [Intermediate Result]({{ site.scenario_settings }}intermediate-result.html). - - diff --git a/introduction/how-to-guide/index.md b/introduction/how-to-guide/index.md deleted file mode 100644 index c040e89f..00000000 --- a/introduction/how-to-guide/index.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: default-layout -title: Dynamsoft Barcode Reader How-to Guides - Main Page -description: This is the main page of Dynamsoft Barcode Reader How-to Guides. -keywords: how-to guides -needAutoGenerateSidebar: false -breadcrumbText: How-to Guide -permalink: /introduction/how-to-guide/ ---- - - -# How-to Guide - -This section covers the following topics: - -- [Check if the barcode image is clear enough for recognition](check-if-the-barcode-image-is-clear-enough-for-recognition.md) -- [Decode DPM data matrix](decode-dpm-data-matrix.md) -- [Enable scale up for barcode recognition](enable-scale-up-for-barcode-recognition.md) -- [Filter out unwanted barcode results](filter-out-unwanted-barcode-results.md) -- [Generate a custom barcode reading template](generate-a-custom-barcode-reading-template.md) -- [Get additional barcode information](get-additional-barcode-information.md) -- [Get detailed barcode information](get-detailed-barcode-information.md) -- [Get intermediate results](get-intermediate-results.md) -- [Read barcodes from camera stream](read-barcode-from-camera-stream.md) -- [Read barcodes with different colors](read-barcodes-with-different-colors.md) -- [Scan in multiple threads](scan-in-multiple-threads.md) -- [Set custom area for HSV pre-detection](set-custom-area-for-hsv-pre-detection.md) -- [Test batch scan performance](test-batch-scan-performance.md) -- [Turn on or off text filter](turn-on-or-off-text-filter.md) - diff --git a/introduction/how-to-guide/read-barcode-from-camera-stream.md b/introduction/how-to-guide/read-barcode-from-camera-stream.md deleted file mode 100644 index 071d7d93..00000000 --- a/introduction/how-to-guide/read-barcode-from-camera-stream.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -layout: default-layout -title: Read Barcodes from Camera Stream - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to read barcodes from camera stream. -keywords: camera stream, frame decoding, image source, StartFrameDecoding, StopFrameDecoding, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/read-barcode-from-camera-stream.html ---- - - -# How-to Guides - Read Barcodes from Camera Stream - -Since v7.0, Dynamsoft Barcode Reader SDK added [`StartFrameDecoding`]({{ site.cpp_methods }}video.html#startframedecoding) and [`StopFrameDecoding`]({{ site.cpp_methods }}video.html#stopframedecoding) APIs. With the APIs and OpenCV library, you can easily read barcodes from video stream. - -Get a sample: [C++ Decode Video Frame](https://www.dynamsoft.com/barcode-reader/resources/code-gallery/?SampleID=224#gallery) > - - -To learn more about what you can set or get during read barcodes from video stream, see [Read Barcode from Different Source]({{ site.scenario_settings }}read-from-diff-source.html). - - -To learn more about the [`StartFrameDecoding`]({{ site.cpp_methods }}video.html#startframedecoding) and [`StopFrameDecoding`]({{ site.cpp_methods }}video.html#stopframedecoding) APIs, see [C++ API Reference]({{ site.cpp_methods }}video.html). diff --git a/introduction/how-to-guide/read-barcodes-with-different-colors.md b/introduction/how-to-guide/read-barcodes-with-different-colors.md deleted file mode 100644 index 7ba7df4f..00000000 --- a/introduction/how-to-guide/read-barcodes-with-different-colors.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -layout: default-layout -title: Read Barcodes with Different Colours - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to read barcodes with different colours. -keywords: colour mode, colourful barcode, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/read-barcodes-with-different-colors.html ---- - - -# How-to Guides - Read Barcodes with Different Colours - -Common barcodes are black and white. However, some barcodes could be in different colors such as the below left barcode. Also, in some cases, a QR code may appear with an image or a logo inside as shown below right. Dynamsoft can decode such special barcodes as well. - - -![Colour Barcode][1] ![Colour Barcode][2] - -In some other cases, the barcodes can be white with a dark background color as shown on the right part of the image below: - -![Dark Background Barcode][3] - -To decode such kind of barcodes, the default runtime settings may fail. You can adjust the `PublicRuntimeSettings` like below: - -```cpp -char sError[512]; -TextResultArray* paryResult = NULL; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -CBarcodeReader* reader = new CBarcodeReader(); -//Initialize license prior to any decoding -//Replace "" with your own license -reader->InitLicense(""); - -//Change the runtime settings to read both normal and inverted barcodes -reader->GetRuntimeSettings(runtimeSettings); -runtimeSettings->furtherModes.grayscaleTransformationModes[0] = GTM_ORIGINAL; -runtimeSettings->furtherModes.grayscaleTransformationModes[1] = GTM_INVERTED; -reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); - -//Replace "" with your own file path -reader->DecodeFile("", ""); -// If succeeds -reader->GetAllTextResults(&paryResult); -CBarcodeReader::FreeTextResults(&paryResult); -delete runtimeSettings; -delete reader; -``` - - -See [Image Scale and Colour Conversion]({{ site.scenario_settings }}image-scale-and-colour-conversion.html) for more information about what you can do during image pre-processing. - - - -[1]: assets/read-barcodes-with-different-colors/color-barcode.png - -[2]: assets/read-barcodes-with-different-colors/color-barcode-2.png - -[3]: assets/read-barcodes-with-different-colors/dark-background-barcode.png - - diff --git a/introduction/how-to-guide/scan-in-multiple-threads.md b/introduction/how-to-guide/scan-in-multiple-threads.md deleted file mode 100644 index 0670aa2e..00000000 --- a/introduction/how-to-guide/scan-in-multiple-threads.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: default-layout -title: Scan in Multiple Threads - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to use Dynamsoft Barcode Reader in multiple threads. -keywords: multiple threads, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/scan-in-multiple-threads.html ---- - - -# How-to Guides - Scan in Multiple Threads - -To scan barcodes in multiple threads using Dynamsoft Barcode Reader, you need to create multiple instances of `BarcodeReader` and run separate instance in each thread. Please don't have multiple threads access the same `BarcodeReader` object. - -We have a sample that shows how to use multiple threads to read barcodes from images using the C++ API. - -Get the sample: MultiThreadDecoding Sample in C++ >. diff --git a/introduction/how-to-guide/set-custom-area-for-accompanying-texts.md b/introduction/how-to-guide/set-custom-area-for-accompanying-texts.md deleted file mode 100644 index a0f038e9..00000000 --- a/introduction/how-to-guide/set-custom-area-for-accompanying-texts.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -layout: default-layout -title: Set Custom Area for Accompanying Texts - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to set custom area for accompanying texts. -keywords: accompanying texts, custom setting, text area, AccompanyingTextRecognitionModes, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/set-custom-area-for-accompanying-texts.html ---- - - -# How-to Guides - Set Custom Area for Accompanying Texts - - -In some circumstances (especially for 1D barcodes), a barcode is typically accompanied by a human readable text. Since version 7.3, Dynamsoft Barcode Reader SDK is able to recognize the accompanying human readable text of a barcode. This text is useful for users to check whether the returned barcode result is correct. - - -By default, our library will check the top and bottom areas of the barcode for accompanying texts. However, you can set a custom area via the following parameters: - - -| Mode Parameter Name | Argument Name | Argument Description | Value Range | Default Value | -| ------------------- | ------------- | -------------------- | ----------- | ------------- | -| AccompanyingTextRecognitionModes | RegionBottom | Specifies the y-coordinate of the bottom-right corner of the region in percentage. This value is relative to the top-left corner of the barcode. | [-255, 255] | 0 | -| AccompanyingTextRecognitionModes | RegionLeft | Specifies the x-coordinate of the top-left corner of the region in percentage. This value is relative to the top-left corner of the barcode. | [-255, 255] | 0 | -| AccompanyingTextRecognitionModes | RegionRight | Specifies the x-coordinate of the bottom-right corner of the region in percentage. This value is relative to the top-left corner of the barcode. | [-255, 255] | 0 | -| AccompanyingTextRecognitionModes | RegionTop | Specifies the y-coordinate of the top-left corner of the region in percentage. This value is relative to the top-left corner of the barcode. | [-255, 255] | 0 | - - - - -To specify the region of the accompanying texts, you need to set [`PublicRuntimeSettings`]({{ site.structs }}PublicRuntimeSettings.html)->[`FurtherModes`]({{ site.structs }}FurtherModes.html)->[AccompanyingTextRecognitionModes]({{ site.structs }}FurtherModes.html#accompanyingtextrecognitionmodes) to ATRM_GENERAL and then specify AccompanyingTextRecognitionModes.RegionLeft, AccompanyingTextRecognitionModes.RegionLeft, AccompanyingTextRecognitionModes.RegionLeft and AccompanyingTextRecognitionModes.RegionLeft individually. The following diagram shows examples on how to set the value: - -![Accompanying Text Example][1] - - -Below is the code snippet on how to set custom area for accompanying texts in Java: - -```java -BarcodeReader br = new BarcodeReader(); - -PublicRuntimeSettings runtimeSettings = br.getRuntimeSettings(); -runtimeSettings.expectedBarcodesCount = iMaxCount; -runtimeSettings.barcodeFormatIds = barcodeFormatIds; -runtimeSettings.barcodeFormatIds_2 = barcodeFormatIds_2; -runtimeSettings.furtherModes.accompanyingTextRecognitionModes[0] = EnumAccompanyingTextRecognitionMode.ATRM_GENERAL; -br.updateRuntimeSettings(runtimeSettings); -br.setModeArgument("AccompanyingTextRecognitionModes", 0, "RegionBottom", "150"); -br.setModeArgument("AccompanyingTextRecognitionModes", 0, "RegionLeft", "-10"); -br.setModeArgument("AccompanyingTextRecognitionModes", 0, "RegionRight", "85"); -br.setModeArgument("AccompanyingTextRecognitionModes", 0, "RegionTop", "100"); - -TextResult[] results = br.decodeFile("", ""); -String pszTemp = String.format("Total barcode(s) found: %d. Total time spent: %.3f seconds.", results.length, ((float) (ullTimeEnd - ullTimeBegin) / 1000)); -iIndex = 0; -for (TextResult result : results) { - iIndex++; - pszTemp = String.format(" Barcode %d:", iIndex); - System.out.println(pszTemp); - pszTemp = " Value: " + result.barcodeText; - System.out.println(pszTemp); - byte[] byteArray = result.results[0].accompanyingTextBytes; - String str = new String(byteArray); - System.out.println("accompanyingTextBytes : " + str); -} -``` - -More useful information about Accompanying Texts can be found: -- Parameter [`AccompanyingTextRecognitionModes`]({{ site.parameters_reference }}accompanying-text-recognition-modes.html#accompanyingtextrecognitionmodes) -- Enumeration [`AccompanyingTextRecognitionMode`]({{ site.enumerations }}parameter-mode-enums.html#accompanyingtextrecognitionmode) -- [Recognise Accompanying Text]({{ site.scenario_settings }}recognise-accompanying-text.html) - - - -[1]: assets/set-custom-area-for-accompanying-texts/accompanying-text-zone.png - diff --git a/introduction/how-to-guide/set-custom-area-for-hsv-pre-detection.md b/introduction/how-to-guide/set-custom-area-for-hsv-pre-detection.md deleted file mode 100644 index 5a691f9e..00000000 --- a/introduction/how-to-guide/set-custom-area-for-hsv-pre-detection.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -layout: default-layout -title: Set Custom Area for HSV Pre-detection - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to set custom area for HSV Pre-detection. -keywords: pre-detection, pre-detected region, hsv, custom setting, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/set-custom-area-for-hsv-pre-detection.html ---- - - -# How-to Guides - Set Custom Area for HSV Pre-detection - -Since version 7.4, Dynamsoft Barcode Reader SDK is able to detect ROI (region of interest) using the HSV colour space. - -It will be useful if the barcode you want to detect is near to a colour zone. For example, in supermarkets and shopping malls, the price is highlighted in red and the barcode might be near to the red zone. To boost the speed of localizing the barcode region, you can preset the colour value of the price label and the position of the barcode relative to the colour zone. - -Let's take the following image for example: - -![HSV Color Image][1] - -Suppose the red rectangle is the price tag and the barcode under the red rectangle (highlighted in green) is what we want to recognize. - - -![Pre-detect Region Image][2] - -Here is the code snippet in C++: - - -```cpp -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings; -reader->GetRuntimeSettings(runtimeSettings); -runtimeSettings->furtherModes.regionPredetectionModes[0] = RPM_GENERAL_HSV_CONTRAST; -reader->UpdateRuntimeSettings(runtimeSettings, errorMessage, 256); -reader.SetModeArgument("regionPredetectionModes", 0, "RelativeBarcodeRegions", "[50,100,100,200,0]", errorMessage, 256); -// [50,100,100,200,0] is the green rectangle in the image below, which is the searching area for the barcode (relative to the colour zone). -reader.SetModeArgument("regionPredetectionModes", 0, "ForeAndBackgroundColours", "[0,-1,5]", errorMessage, 256); -// "[0,-1,5]" - define red colour zone as ROI -reader.SetModeArgument("regionPredetectionModes", 0, "HeightRange", "[300,400]", errorMessage, 256); -reader.SetModeArgument("regionPredetectionModes", 0, "WidthRange", "[600,700]", errorMessage, 256); -reader.SetModeArgument("regionPredetectionModes", 0, "AspectRatioRange", "[25,100]", errorMessage, 256); -// invoke decode method... -``` - - -For more information about region pre-detection, please see [How to Use Region Predetection]({{ site.scenario_settings }}how-to-use-region-predetection.html). - - - -[1]: assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-sample.png - -[2]: assets/set-custom-area-for-hsv-pre-detection/hsv-predetection-explanation.png - - - diff --git a/introduction/how-to-guide/test-batch-scan-performance.md b/introduction/how-to-guide/test-batch-scan-performance.md deleted file mode 100644 index 30890e9e..00000000 --- a/introduction/how-to-guide/test-batch-scan-performance.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -layout: default-layout -title: Test Batch Scan Performance - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to test batch scan performance. -keywords: test batch, scan performance, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/test-batch-scan-performance.html ---- - - -# How-to Guides - Test Batch Scan Performance - -This guide introduces how to use the tools by Dynamsoft to read barcodes from files in a specified directory and get decoding results plus performance metrics. This will be helpful for you to evaluate the performance of Dynamsoft Barcode Reader. - - -## Related Files - -Here are the related files which can be found at `[Installation Folder]\Samples\Desktop\Bin\BatchDecode\`: - -- `BatchDecode.exe` is a tool to help you evaluate the barcode scanning performane. It provides performance testing data by calling the SDK to decode barcodes from a batch of images in a specified folder. - -- `BatchDecodeProjectGuardian.exe` is an auxiliary tool provided by Dynamsoft. The tool can monitor a specified program, restart it when the program crashes or becomes unresponsive, and keep a log of running records. - -- `GuardianConfig.ini` is the configuration file for `BatchDecodeProjectGuardian.exe`. - - -## Configure the Settings - -First, let's configure the image directory in `GuardianConfig.ini`. Fields in the configuration file: - -- **ApplicationPath**: Specifies the program to be guarded. -- **ApplicationArgument**: Sets the input parameters of the guarded program, separated by spaces. -- **ApplicationLogDir**: Sets output folder of the guarded program. -- **TimeOutMin**: Sets the daemon timeout value. When the guarded program has no new output for the specified time, the program will be restarted. The default timeout value is 2 minutes. Time unit: minutes. - - -Open `GuardianConfig.ini`, set `-i` of the `ApplicationArgument` field to the file directory of the barcode images to be processed. The default directory is the Images folder under the installation folder of Dynamsoft Barcode Reader. - -Save the settings. - - -## Run the BatchDecodeProjectGuardian Daemon Tool - -After configuring `GuardianConfig.ini` as needed, double click `BatchDecodeProjectGuardian.exe` and it will open a console window as follows (take BatchDecode as an example): - - -![Daemon Execution Interface][1] -Figure 1 - Daemon Execution Interface - - -Once the tool is started, it will output a record every 10 seconds to report the current running status of the guarded program. The tool will exit when the program finishes the execution and exits successfully. - -If the guarded program crashes or times out during the running, `BatchDecodeProjectGuardian.exe` is running, the daemon tool will actively restart the program and display the corresponding restart information in the console interface as well as record it in the GuardianLog file. - -After running `BatchDecodeProjectGuardian.exe`, a csv file with the name "GuardianLog_" + daemon name + runtime will be created in the same directory. The file records the working status of the daemon. Each time the guarded program is started or restarted, a record will be registered in the log file. - -Fields in the log file: - -- **Application_ID**: Marks the name of the program being guarded, distinguished by time. -- **Running_Status**: Indicates the status of the daemon, including: running, finished, timeout, and crashed. -- **Start_Time**: Indicates the start time of the run. -- **End_Time**: Indicates the end time of the run. -- **Latest_Log**: Logs the information when the program times out or exits abnormally. The log content consists of result file path plus the last line of the result content. - - -## Run the BatchDecode Performance Testing Tool - -### Command line startup parameters - -`> BatchDecode.exe[-i] [-o]` - -- -i: Sets the directory where the barcode files to be evaluated is located, for example: - -i "D:\\images". - The default is the directory where BatchDecode.exe exists. - -- -o: Sets the directory to output the evaluation results, for example: - -o "D:\\output". - The default is the directory where BatchDecode.exe exists. - -If the program is started without any command line parameters or you run it by double clicking, the following interface will be displayed: - - -![The Startup Interface of the Evaluation Program without Command Parameters][2] -Figure 2 - The Startup Interface of the Evaluation Program without Command Parameters - - -You can follow the interface prompts. After setting the parameters, input `r` to automatically starts the performance evaluation of your barcode files. - -You can find the performance result in the output directory you specified, with the name of `DBR_T_DEFULT_xxxxx.csv`. There is an additional file `DBR_T_DEFULT_xxxxx_original.txt` storing the original barcode decoding results which cannot be displayed in the csv file. - - - -## Interpretation of Results - -After executing the program, you can see the performance testing results in `DBR_T_DEFULT_xxxxx.csv` in the output directory. Open the file and you can see the following fields: - - -| Field | Description | -|-------|-------------| -| No. | ID of the barcode file. | -| Image Source | Path of the source image files. | -| Read Duration (ms) | The time spent reading barcodes in the file. Unit in ms. | -| Barcode Count | Count of barcodes decoded in the file. | -| Barcode Hex | Hex encoding of all the decoded barcode content decoded. Mainly used for comparing different identification results. | -| Barcode Text | The content of the barcode identified. If the recognition result cannot be full displayed due to the output format and word count limit, the field 'Original' will be set to No. | -| Original | If the value of this field is No, you can refer to the 'Note' section at the bottom of the file to see the details of the barcode. | - - - -The statistics section of the document: - - -| Field | Description | -|-------|-------------| -| Total Image Count | Number of image files processed | -| Images with Barcodes Recognized | Number of image files with barcodes recognized | -| Total Barcode Count | Total barcodes recognized | -| Time Cost of All Images (ms) | Total time spent on reading barcodes from all images | -| Recognition Rate | Percentage of images with barcodes recognized, i.e., Images with Barcodes Recognized / Total Image | -| Avg Time of Total Scan Per Image (ms) | The average time spent for decoding an image file, i.e., Total Time Spent for Recognition / Total Image Count | -| Avg Time of Total Scan Per Barcode (ms) | The average time spent decoding a barcode, i.e., Total Time Cost of All Images / Total Barcode Count. | -| Time Cost of Images with Barcodes Recognized (ms) | Total time spent decoding images with barcodes recognized | -| Avg Time of Successful Scan Per Image (ms) | The average time spent decoding an image file with barcodes found, i.e., Time Spent for Recognition Images with Barcodes Found / Images with Barcodes Recognized | - - - - - -[1]: assets/test-batch-scan-performance/daemon-execution-interface.png - -[2]: assets/test-batch-scan-performance/startup-interface.png diff --git a/introduction/how-to-guide/turn-on-or-off-text-filter.md b/introduction/how-to-guide/turn-on-or-off-text-filter.md deleted file mode 100644 index a27c90be..00000000 --- a/introduction/how-to-guide/turn-on-or-off-text-filter.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -layout: default-layout -title: Turn On or Turn Off Text Filter - Dynamsoft Barcode Reader How-to Guides -description: This page shows how to turn on/off Text Filter. -keywords: text filter, TextFilterModes, how-to guides -needAutoGenerateSidebar: false -permalink: /introduction/how-to-guide/turn-on-or-off-text-filter.html ---- - - -# How-to Guides - Turn On or Turn Off Text Filter - -In some cases, the image may be filled with a lot of characters and numbers. This could affect the barcode recognition. With text filter on, it can filter and remove the characters and numbers from the image and improve the barcode recognition accuracy. However, you may want to turn off text filter when barcodes are the only content of the image or when the speed is the prority. - -The text filter is on by default. - -The following code snippet shows how to set text filter function by changing the [`TextFilterModes`]({{ site.parameters_reference }}text-filter-modes.html#textfiltermodes) parameter: - - -```cpp -char sError[512]; -TextResultArray* paryResult = NULL; -PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); -CBarcodeReader* reader = new CBarcodeReader(); -//Initialize license prior to any decoding -//Replace "Put your license key here" with your own license -reader->InitLicense("Put your license key here"); - -reader->GetRuntimeSettings(runtimeSettings); -//Turn off the text filter function. The enumeration includes TFM_GENERAL_CONTOUR, -//which is used to turn on the function, and TFM_AUTO. -runtimeSettings->furtherModes.textFilterModes[0] = TFM_SKIP; -reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); - -//Replace "Put the path of your file here" with your own file path -reader->DecodeFile("Put your file path here", ""); -// If succeeds -reader->GetAllTextResults(&paryResult); -CBarcodeReader::FreeTextResults(&paryResult); -delete runtimeSettings; -delete reader; -``` - - - -For more information about text filter, please see [Text Filter]({{ site.scenario_settings }}text-filter.html). - - diff --git a/programming/features/assets/dark-background-barcodes.png b/programming/features/assets/dark-background-barcodes.png deleted file mode 100644 index b720de0d..00000000 Binary files a/programming/features/assets/dark-background-barcodes.png and /dev/null differ diff --git a/programming/features/read-barcodes-with-small-module-size.md b/programming/features/read-barcodes-with-small-module-size.md index ede692ee..33550725 100644 --- a/programming/features/read-barcodes-with-small-module-size.md +++ b/programming/features/read-barcodes-with-small-module-size.md @@ -17,11 +17,15 @@ A module is the narrowest "bar" in a 1D barcode, or the smallest "box" in a 2D b In some scenarios, the barcode is very small relative to the entire image, and its module size is even smaller, making it difficult for the library to read the barcode. In this case, we can use the parameter `BarcodeScaleModes` in to enlarge the barcode symbol for easier processing. +For linear barcodes, a practical recommendation is to keep the narrowest module (X-dimension) at or above 2 pixels. + ## Particular Parameter Required Dynamsoft Barcode Reader (DBR) provides a parameter [`BarcodeScaleModes`]({{ site.dcvb_parameters_reference }}barcode-reader-task-settings/barcode-scale-modes.html) that allows you to control the scale-up process when targets in the image are too small. +Scale-up is condition-based: when module size is smaller than `ModuleSizeThreshold` and the acute angle with the X axis is greater than `AcuteAngleWithXThreshold`, DBR enlarges the symbol iteratively until the effective module size reaches `TargetModuleSize`. + ## Example Below is an example illustrating how to configure the parameter `BarcodeScaleModes`. diff --git a/programming/features/read-video-streaming-desktop.md b/programming/features/read-video-streaming-desktop.md deleted file mode 100644 index 6216cb6e..00000000 --- a/programming/features/read-video-streaming-desktop.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -layout: default-layout -title: Read Barcode from Video Streaming - Dynamsoft Barcode Reader SDK -description: This page describes how to read barcodes from video streams on desktop in Dynamsoft Barcode Reader SDK, covering the frame queue mechanism, the decoding thread, and the blurred-frame filtering feature via AppendFrame and related APIs. -keywords: Different Source -needAutoGenerateSidebar: true -needGenerateH3Content: true -noTitleIndex: true -permalink: /programming/features/read-video-streaming-desktop.html ---- - -# Read Barcode from Video Streaming - -DBR provides several processing interfaces for video streams, which facilitates the processing of video frame queues and multi-threading. - -DBR creates a queue to store the video frames currently being processed and then creates a decoding thread to process that queue. The decoding thread takes the latest frame in the queue for processing and then takes it out of the queue after decoding to move on to the next frame in the queue. The results will be put into a result queue. If the length of the queue to be processed reaches the maximum value you set, the decoding thread will quit the frame it is currently processing as soon as possible and empty the queue. The thread then waits for new frames to join the queue and restart the process to prevent a frame from taking too long. - -DBR also provides the feature to filter blurred frames. When enabled, DBR will calculate the sharpness of the image frames in the queue to be processed, and the frames whose sharpness is lower than the threshold you set will be removed. The main APIs are as follows - -- [`AppendFrame`] - Appends a frame image buffer to the inner frame queue. -- [`StartFrameDecoding`] - Starts a new thread to decode barcodes from the inner frame queue. -- [`StartFrameDecodingEx`] - Starts a new thread to decode barcodes from the inner frame queue. -- [`SetTextResultCallback`] - Sets call back function to process text results generated during frame decoding. DBR will start a thread loop to check the result queue when processing the video stream. If new results are put into the queue, the callback function will be called -- [`StopFrameDecoding`] - Stops the frame decoding thread created by StartFrameDecoding. -- [`InitFrameDecodingParameters`] - Init `FrameDecodingParameters` object -- [`FrameDecodingParameters`] - Defines a struct to configure the frame decoding parameters. The structure provides a series of configuration parameters for users to configure the processing method of DBR involving video streams. The main fields are as follows: - - `maxQueueLength` - The maximum number of frames waiting for decoding - - `maxResultQueueLength` - The maximum number of frames waiting results (text result/localization result) will be kept for further reference. - - `width` - The width of the frame image in pixels. - - `height` - The height of the frame image in pixels. - - `stride` - The number of single-bytes of the image in pixels. - - `imagePixelFormat` - The image pixel format used in the image byte array. - - `region` - The region definition of the frame to calculate the internal indicator.This is a rectangular area. After setting, DBR only performs decoding within the area. - - `autoFilter` - Sets whether to filter frames automatically. The default is 1: Enable filtering frames automatically. - - `threshold` - The threshold used for filtering frames. Range 0-1, the smaller the value, the easier the image frame will be filtered out. - - `fps` - The frequency of calling `AppendFrame` per second. DBR will refer to this value when performing fuzzy frame filtering logic. If it is not set, then DBR will estimate based on the frequency of calling `AppendFrame`. - -The following example demonstrates these interfaces. In this example, we use opencv to read camera data and call DBR's video streaming interface to decode. - -
- >- C - >- C++ - >- C# - >- Java - >- Python - > ->```c -``` ->```cpp -``` ->```c# -``` ->```java -``` ->```python -```