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
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ dcvb_parameters: /capture-vision/docs/core/parameters/
dcvb_parameters_reference: /capture-vision/docs/core/parameters/reference/
dcvb_enumerations: /capture-vision/docs/core/enums/
dcvb_cpp_api: /capture-vision/docs/server/programming/cplusplus/api-reference/
dcvb_dotnet_api: /capture-vision/docs/server/programming/dotnet/api-reference/
dcvb_python_api: /capture-vision/docs/server/programming/python/api-reference/

maui: /barcode-reader/docs/mobile/programming/maui/
maui_api: /barcode-reader/docs/mobile/programming/maui/api-reference/
Expand Down
151 changes: 58 additions & 93 deletions programming/features/barcode-formats-and-count.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ You can configure the parameter in two different ways, depending on your require
>- Android
>- Objective-C
>- Swift
>- Python
>- C#
>
>
```javascript
Expand Down Expand Up @@ -84,9 +86,36 @@ do{
// Add code to do when error occurs.
}
```
>
```python
cvr_instance = CaptureVisionRouter()
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
# Specify the barcode formats by enumeration values.
# Use "|" to enable multiple barcode formats at one time.
settings.barcode_settings.barcode_format_ids = EnumBarcodeFormat.BF_QR_CODE.value | EnumBarcodeFormat.BF_ONED.value
# Update the settings.
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
```
>
```csharp
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
{
SimplifiedCaptureVisionSettings settings;
string errorMsg;
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
// Specify the barcode formats by enumeration values.
// Use "|" to enable multiple barcode formats at one time.
settings.barcodeSettings.barcodeFormatIds = (ulong)(EnumBarcodeFormat.BF_QR_CODE | EnumBarcodeFormat.BF_ONED);
// Update the settings.
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
}
```


* Configure barcode format via `JSON parameter template file`
* update parameter `BarcodeFormatIds` in your JSON template
* Update parameter `BarcodeFormatIds` in your JSON template
```json
{
"CaptureVisionTemplates": [
Expand All @@ -110,52 +139,7 @@ do{
}
```

* apply settings by calling method `InitSettingsFromFile`

<div class="sample-code-prefix template2"></div>
>- JavaScript
>- C++
>- Android
>- Objective-C
>- Swift
>
>
```javascript
// `router` is an instance of `CaptureVisionRouter`.
// In the JS edition, the method name we use for initialization is different.
router.initSettings("PATH-TO-YOUR-SETTING")
```
>
```c++
char szErrorMsg[256] = {0};
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
// more process here
```
>
```java
try {
// `cvr` is an instance of `CaptureVisionRouter`.
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
} catch (CaptureVisionRouterException e) {
e.printStackTrace();
}
```
>
```objc
NSError *error;
// `cvr` is an instance of `DSCaptureVisionRouter`.
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
```
>
```swift
do{
//`cvr` is an instance of `CaptureVisionRouter`.
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
}catch{
// Add code to do when error occurs.
}
```
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).

## Set Barcode Count

Expand All @@ -178,6 +162,8 @@ You can configure the parameter in two different ways, depending on your require
>- Android
>- Objective-C
>- Swift
>- Python
>- C#
>
>
```javascript
Expand Down Expand Up @@ -236,6 +222,30 @@ do{
// Add code to do when error occurs.
}
```
>
```python
cvr_instance = CaptureVisionRouter()
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
# Specify the expected barcode count.
settings.barcode_settings.expected_barcodes_count = 1
# Update the settings.
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
```
>
```csharp
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
{
SimplifiedCaptureVisionSettings settings;
string errorMsg;
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
// Specify the expected barcode count.
settings.barcodeSettings.expectedBarcodesCount = 1;
// Update the settings.
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
}
```

* Configure barcode format via `JSON parameter template file`
* update parameter `ExpectedBarcodesCount` in your JSON template
Expand All @@ -261,49 +271,4 @@ do{
]
}
```
* apply settings by calling method `InitSettingsFromFile`

<div class="sample-code-prefix template2"></div>
>- JavaScript
>- C++
>- Android
>- Objective-C
>- Swift
>
>
```javascript
// `router` is an instance of `CaptureVisionRouter`.
// In the JS edition, the method name we use for initialization is different.
router.initSettings("PATH-TO-YOUR-SETTING")
```
>
```c++
char szErrorMsg[256] = {0};
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
// more process here
```
>
```java
try {
// `cvr` is an instance of `CaptureVisionRouter`.
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
} catch (CaptureVisionRouterException e) {
e.printStackTrace();
}
```
>
```objc
NSError *error;
// `cvr` is an instance of `DSCaptureVisionRouter`.
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
```
>
```swift
do{
//`cvr` is an instance of `CaptureVisionRouter`.
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
}catch{
// Add code to do when error occurs.
}
```
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
39 changes: 39 additions & 0 deletions programming/features/barcode-scan-region.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Dynamsoft Barcode Reader (DBR) will locate the code region and decode the entire
<div class="sample-code-prefix template2"></div>
>- JavaScript
>- C++
>- Python
>- C#
>
>
```javascript
Expand Down Expand Up @@ -48,6 +50,43 @@ settings.roiMeasuredInPercentage = 1;
// Update the settings.
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
```
>
```python
cvr_instance = CaptureVisionRouter()
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
# Specify the ROI.
settings.roi_measured_in_percentage = 1
points = settings.roi.points
points[0].x = 10
points[0].y = 10
points[1].x = 90
points[1].y = 10
points[2].x = 90
points[2].y = 90
points[3].x = 10
points[3].y = 90
# Update the settings.
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
```
>
```csharp
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
{
SimplifiedCaptureVisionSettings settings;
string errorMsg;
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
// Specify the ROI.
settings.roiMeasuredInPercentage = 1;
settings.roi.points[0].Set(10, 10);
settings.roi.points[1].Set(90, 10);
settings.roi.points[2].Set(90, 90);
settings.roi.points[3].Set(10, 90);
// Update the settings.
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
}
```

* Configure region via `JSON Template`

Expand Down
33 changes: 30 additions & 3 deletions programming/features/control-terminate-phase.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Below is an example illustrating how to configure parameter `TerminateSetting` v
}
```

To apply the above settings, please follow the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).

## Timeout

Expand All @@ -67,6 +67,8 @@ You can configure the parameter in two different ways, depending on your require
<div class="sample-code-prefix template2"></div>
>- JavaScript
>- C++
>- Python
>- C#
>
>
```javascript
Expand All @@ -84,11 +86,35 @@ char szErrorMsg[256] = {0};
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
SimplifiedCaptureVisionSettings settings;
cvr->GetSimplifiedSettings(CPresetTemplate::PT_READ_BARCODES, &settings);
// Specify the expected barcode count.
// Specify the timeout.
settings.timeout = 1000;
// Update the settings.
cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 256);
```
>
```python
cvr_instance = CaptureVisionRouter()
# Obtain current runtime settings of `CCaptureVisionRouter` instance.
err_code, err_str, settings = cvr_instance.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
# Specify the timeout.
settings.timeout = 1000
# Update the settings.
err_code, err_str = cvr_instance.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
```
>
```csharp
using (CaptureVisionRouter cvr = new CaptureVisionRouter())
{
SimplifiedCaptureVisionSettings settings;
string errorMsg;
// Obtain current runtime settings of `CCaptureVisionRouter` instance.
cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
// Specify the timeout.
settings.timeout = 1000;
// Update the settings.
cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
}
```


* Configure parameter `Timeout` via `JSON Template`
Expand Down Expand Up @@ -116,4 +142,5 @@ cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &settings, szErrorMsg, 25
}
```

To apply the above settings, please follow the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).

51 changes: 3 additions & 48 deletions programming/features/filter-and-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Dynamsoft Barcode Reader SDK is able to read multiple barcodes at once and retur
* [TextResultOrderModes]({{ site.dcvb_parameters_reference }}barcode-reader-task-settings/text-result-order-modes.html)


## Sample Code
## Example

Below is an example illustrating how to filter out QR Code results with confidence higher than 50 and then order the results by position.

* update parameters in your JSON template
* Update parameters in your JSON template

```json
{
Expand Down Expand Up @@ -64,49 +64,4 @@ Below is an example illustrating how to filter out QR Code results with confiden
}
```

* apply settings by calling method `InitSettingsFromFile`

<div class="sample-code-prefix template2"></div>
>- JavaScript
>- C++
>- Android
>- Objective-C
>- Swift
>
>
```javascript
// `router` is an instance of `CaptureVisionRouter`.
// In the JS edition, the method name we use for initialization is different.
router.initSettings("PATH-TO-YOUR-SETTING")
```
>
```c++
char szErrorMsg[256] = {0};
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
// more process here
```
>
```java
try {
// `cvr` is an instance of `CaptureVisionRouter`.
cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
} catch (CaptureVisionRouterException e) {
e.printStackTrace();
}
```
>
```objc
NSError *error;
// `cvr` is an instance of `DSCaptureVisionRouter`.
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
```
>
```swift
do{
//`cvr` is an instance of `CaptureVisionRouter`.
try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
}catch{
// Add code to do when error occurs.
}
```
* Apply the above settings following the article [Use Templates for Configuring Parameters]({{ site.features }}use-runtimesettings-or-templates.html#json-template).
Loading