Skip to content

Commit cc278f1

Browse files
Merge pull request #1 from yebuyebu/main
speed/accuracy/readrate
2 parents 2f07591 + 0aa49ba commit cc278f1

20 files changed

+1373
-68
lines changed

CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ option(BUILD_CPP_HELLOWORLD "Build the sample HelloWorld under ./samples/C++/Hel
1313
option(BUILD_CPP_GENERALSETTINGS "Build the sample GeneralSettings under ./samples/C++/GeneralSettings" ON)
1414
option(BUILD_CPP_BATCHDECODE "Build the sample BatchDecode under ./samples/C++/Performance/BatchDecode" ON)
1515
option(BUILD_CPP_VIDEODECODING "Build the sample VideoDecoding under ./samples/C++/VideoDecoding" ON)
16+
option(BUILD_CPP_SPEEDFIRSTSETTINGS "Build the sample SpeedFirstSettings under ./sample/C++/Performance/SpeedFirstSettings" ON)
17+
option(BUILD_CPP_ACCURACYFIRSTSETTINGS "Build the sample AccuracyFirstSettings under ./sample/C++/Performance/AccuracyFirstSettings" ON)
18+
option(BUILD_CPP_READRATEFIRSTSETTINGS "Build the sample ReadRateFirstSettings under ./sample/C++/Performance/ReadRateFirstSettings" ON)
1619

1720
if(BUILD_LINUX)
1821
set(DBRLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/Linux)
@@ -51,7 +54,16 @@ endif()
5154
if(BUILD_CPP_VIDEODECODING)
5255
add_subdirectory(samples/C++/VideoDecoding)
5356
endif()
57+
if(BUILD_CPP_SPEEDFIRSTSETTINGS)
58+
add_subdirectory(samples/C++/Performance/SpeedFirstSettings)
59+
endif()
60+
if(BUILD_CPP_ACCURACYFIRSTSETTINGS)
61+
add_subdirectory(samples/C++/Performance/AccuracyFirstSettings)
62+
endif()
63+
if(BUILD_CPP_READRATEFIRSTSETTINGS)
64+
add_subdirectory(samples/C++/Performance/ReadRateFirstSettings)
65+
endif()
5466

55-
if(BUILD_C_HELLOWORLD OR BUILD_C_GENERALSETTINGS OR BUILD_CPP_HELLOWORLD OR BUILD_CPP_GENERALSETTINGS)
67+
if(BUILD_C_HELLOWORLD OR BUILD_C_GENERALSETTINGS OR BUILD_CPP_HELLOWORLD OR BUILD_CPP_GENERALSETTINGS OR BUILD_CPP_SPEEDFIRSTSETTINGS OR BUILD_CPP_ACCURACYFIRSTSETTINGS OR BUILD_CPP_READRATEFIRSTSETTINGS)
5668
File(COPY ./images/AllSupportedBarcodeTypes.png DESTINATION images)
5769
endif()

samples/C++/BarcodeReaderSamples.sln

Lines changed: 90 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,90 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30717.126
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\HelloWorld.vcxproj", "{1B801EDF-8FD8-43FC-9539-7659AF0605C7}"
7-
EndProject
8-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeneralSettings", "GeneralSettings\GeneralSettings.vcxproj", "{C525F421-781A-4144-A201-57E709641EA4}"
9-
EndProject
10-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BatchDecode", "Performance\BatchDecode\BatchDecode.vcxproj", "{52E47374-474B-423C-B891-9918E94D3F28}"
11-
EndProject
12-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoDecoding", "VideoDecoding\VideoDecoding.vcxproj", "{6BAC218D-AD85-4749-9694-0B8A8547596B}"
13-
EndProject
14-
Global
15-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
16-
Debug|x64 = Debug|x64
17-
Debug|x86 = Debug|x86
18-
Release|x64 = Release|x64
19-
Release|x86 = Release|x86
20-
EndGlobalSection
21-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x64.ActiveCfg = Debug|x64
23-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x64.Build.0 = Debug|x64
24-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x86.ActiveCfg = Debug|Win32
25-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x86.Build.0 = Debug|Win32
26-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x64.ActiveCfg = Release|x64
27-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x64.Build.0 = Release|x64
28-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x86.ActiveCfg = Release|Win32
29-
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x86.Build.0 = Release|Win32
30-
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x64.ActiveCfg = Debug|x64
31-
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x64.Build.0 = Debug|x64
32-
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x86.ActiveCfg = Debug|Win32
33-
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x86.Build.0 = Debug|Win32
34-
{C525F421-781A-4144-A201-57E709641EA4}.Release|x64.ActiveCfg = Release|x64
35-
{C525F421-781A-4144-A201-57E709641EA4}.Release|x64.Build.0 = Release|x64
36-
{C525F421-781A-4144-A201-57E709641EA4}.Release|x86.ActiveCfg = Release|Win32
37-
{C525F421-781A-4144-A201-57E709641EA4}.Release|x86.Build.0 = Release|Win32
38-
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x64.ActiveCfg = Debug|x64
39-
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x64.Build.0 = Debug|x64
40-
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x86.ActiveCfg = Debug|Win32
41-
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x86.Build.0 = Debug|Win32
42-
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x64.ActiveCfg = Release|x64
43-
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x64.Build.0 = Release|x64
44-
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x86.ActiveCfg = Release|Win32
45-
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x86.Build.0 = Release|Win32
46-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x64.ActiveCfg = Release|Win32
47-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x64.Build.0 = Release|Win32
48-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x86.ActiveCfg = Release|Win32
49-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x86.Build.0 = Release|Win32
50-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x64.ActiveCfg = Release|Win32
51-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x86.ActiveCfg = Release|Win32
52-
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x86.Build.0 = Release|Win32
53-
EndGlobalSection
54-
GlobalSection(SolutionProperties) = preSolution
55-
HideSolutionNode = FALSE
56-
EndGlobalSection
57-
GlobalSection(ExtensibilityGlobals) = postSolution
58-
SolutionGuid = {00C0F81B-6F59-408D-9DDB-A0F7A3E02F4F}
59-
EndGlobalSection
60-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.28307.1169
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWorld", "HelloWorld\HelloWorld.vcxproj", "{1B801EDF-8FD8-43FC-9539-7659AF0605C7}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GeneralSettings", "GeneralSettings\GeneralSettings.vcxproj", "{C525F421-781A-4144-A201-57E709641EA4}"
9+
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BatchDecode", "Performance\BatchDecode\BatchDecode.vcxproj", "{52E47374-474B-423C-B891-9918E94D3F28}"
11+
EndProject
12+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VideoDecoding", "VideoDecoding\VideoDecoding.vcxproj", "{6BAC218D-AD85-4749-9694-0B8A8547596B}"
13+
EndProject
14+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpeedFirstSettings", "Performance\SpeedFirstSettings\SpeedFirstSettings.vcxproj", "{C2918D73-1389-4DAA-9F51-54B182B7F12B}"
15+
EndProject
16+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AccuracyFirstSettings", "Performance\AccuracyFirstSettings\AccuracyFirstSettings.vcxproj", "{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}"
17+
EndProject
18+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReadRateFirstSettings", "Performance\ReadRateFirstSettings\ReadRateFirstSettings.vcxproj", "{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}"
19+
EndProject
20+
Global
21+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
22+
Debug|x64 = Debug|x64
23+
Debug|x86 = Debug|x86
24+
Release|x64 = Release|x64
25+
Release|x86 = Release|x86
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x64.ActiveCfg = Debug|x64
29+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x64.Build.0 = Debug|x64
30+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x86.ActiveCfg = Debug|Win32
31+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Debug|x86.Build.0 = Debug|Win32
32+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x64.ActiveCfg = Release|x64
33+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x64.Build.0 = Release|x64
34+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x86.ActiveCfg = Release|Win32
35+
{1B801EDF-8FD8-43FC-9539-7659AF0605C7}.Release|x86.Build.0 = Release|Win32
36+
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x64.ActiveCfg = Debug|x64
37+
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x64.Build.0 = Debug|x64
38+
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x86.ActiveCfg = Debug|Win32
39+
{C525F421-781A-4144-A201-57E709641EA4}.Debug|x86.Build.0 = Debug|Win32
40+
{C525F421-781A-4144-A201-57E709641EA4}.Release|x64.ActiveCfg = Release|x64
41+
{C525F421-781A-4144-A201-57E709641EA4}.Release|x64.Build.0 = Release|x64
42+
{C525F421-781A-4144-A201-57E709641EA4}.Release|x86.ActiveCfg = Release|Win32
43+
{C525F421-781A-4144-A201-57E709641EA4}.Release|x86.Build.0 = Release|Win32
44+
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x64.ActiveCfg = Debug|x64
45+
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x64.Build.0 = Debug|x64
46+
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x86.ActiveCfg = Debug|Win32
47+
{52E47374-474B-423C-B891-9918E94D3F28}.Debug|x86.Build.0 = Debug|Win32
48+
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x64.ActiveCfg = Release|x64
49+
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x64.Build.0 = Release|x64
50+
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x86.ActiveCfg = Release|Win32
51+
{52E47374-474B-423C-B891-9918E94D3F28}.Release|x86.Build.0 = Release|Win32
52+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x64.ActiveCfg = Release|Win32
53+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x64.Build.0 = Release|Win32
54+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x86.ActiveCfg = Release|Win32
55+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Debug|x86.Build.0 = Release|Win32
56+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x64.ActiveCfg = Release|Win32
57+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x86.ActiveCfg = Release|Win32
58+
{6BAC218D-AD85-4749-9694-0B8A8547596B}.Release|x86.Build.0 = Release|Win32
59+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Debug|x64.ActiveCfg = Debug|x64
60+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Debug|x64.Build.0 = Debug|x64
61+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Debug|x86.ActiveCfg = Debug|Win32
62+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Debug|x86.Build.0 = Debug|Win32
63+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Release|x64.ActiveCfg = Release|x64
64+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Release|x64.Build.0 = Release|x64
65+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Release|x86.ActiveCfg = Release|Win32
66+
{C2918D73-1389-4DAA-9F51-54B182B7F12B}.Release|x86.Build.0 = Release|Win32
67+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Debug|x64.ActiveCfg = Debug|x64
68+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Debug|x64.Build.0 = Debug|x64
69+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Debug|x86.ActiveCfg = Debug|Win32
70+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Debug|x86.Build.0 = Debug|Win32
71+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Release|x64.ActiveCfg = Release|x64
72+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Release|x64.Build.0 = Release|x64
73+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Release|x86.ActiveCfg = Release|Win32
74+
{45B40B29-EEDD-4A39-B3C0-7AC34BBD665F}.Release|x86.Build.0 = Release|Win32
75+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Debug|x64.ActiveCfg = Debug|x64
76+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Debug|x64.Build.0 = Debug|x64
77+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Debug|x86.ActiveCfg = Debug|Win32
78+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Debug|x86.Build.0 = Debug|Win32
79+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Release|x64.ActiveCfg = Release|x64
80+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Release|x64.Build.0 = Release|x64
81+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Release|x86.ActiveCfg = Release|Win32
82+
{AEFC9596-D16D-4790-9C56-E9F58D7B66EA}.Release|x86.Build.0 = Release|Win32
83+
EndGlobalSection
84+
GlobalSection(SolutionProperties) = preSolution
85+
HideSolutionNode = FALSE
86+
EndGlobalSection
87+
GlobalSection(ExtensibilityGlobals) = postSolution
88+
SolutionGuid = {00C0F81B-6F59-408D-9DDB-A0F7A3E02F4F}
89+
EndGlobalSection
90+
EndGlobal

samples/C++/GeneralSettings/GeneralSettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int main()
2828

2929
// 1. Initialize license
3030
/*
31-
// By setting organizaion ID as "200001", a 7-day trial license will be used for license verification.
31+
// By setting organization ID as "200001", a 7-day trial license will be used for license verification.
3232
// Note that network connection is required for this license to work.
3333
//
3434
// When using your own license, locate the following line and specify your Organization ID.

samples/C++/HelloWorld/HelloWorld.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main()
2727

2828
// 1. Initialize license
2929
/*
30-
// By setting organizaion ID as "200001", a 7-day trial license will be used for license verification.
30+
// By setting organization ID as "200001", a 7-day trial license will be used for license verification.
3131
// Note that network connection is required for this license to work.
3232
//
3333
// When using your own license, locate the following line and specify your Organization ID.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#include <string>
2+
#include <fstream>
3+
#include <iostream>
4+
#include "../../../../include/DynamsoftBarcodeReader.h"
5+
#include "../../../../include/DynamsoftCommon.h"
6+
7+
using namespace std;
8+
using namespace dynamsoft::dbr;
9+
10+
// Link libraries of DynamsoftBarcodeReader SDK for Windows.
11+
#if defined(_WIN64) || defined(_WIN32)
12+
#ifdef _WIN64
13+
#pragma comment(lib, "../../../../lib/Windows/x64/DBRx64.lib")
14+
#else
15+
#pragma comment(lib, "../../../../lib/Windows/x86/DBRx86.lib")
16+
#endif
17+
#endif
18+
19+
20+
class AccuracyFirstSettings {
21+
public:
22+
void configAccuracyFirst(CBarcodeReader *reader) {
23+
// Obtain current runtime settings of instance.
24+
PublicRuntimeSettings settings;
25+
reader->GetRuntimeSettings(&settings);
26+
27+
// 1. Set expected barcode format
28+
// The more precise the barcode format is set, the higher the accuracy.
29+
// Mostly, misreading only occurs on reading oneD barcode. So here we use OneD barcode format to demonstrate.
30+
settings.barcodeFormatIds = BF_ONED;
31+
settings.barcodeFormatIds_2 = BF_NULL;
32+
33+
// 2. Set the minimal result confidence.
34+
// The greater the confidence, the higher the accuracy.
35+
// Filter by minimal confidence of the decoded barcode. We recommend using 30 as the default minimal confidence value
36+
settings.minResultConfidence = 30;
37+
38+
// 3. Sets the minimum length of barcode text for filtering.
39+
// The more precise the barcode text length is set, the higher the accuracy.
40+
settings.minBarcodeTextLength = 6;
41+
42+
// Apply the new settings to the instance
43+
reader->UpdateRuntimeSettings(&settings);
44+
45+
}
46+
void configAccuracyFirstByTemplate(CBarcodeReader * reader) {
47+
// Compared with PublicRuntimeSettings, parameter templates have a richer ability to control parameter details.
48+
// Please refer to the parameter explanation in "AccuracyFirstTemplate.json" to understand how to control accuracy first.
49+
int ret = reader->InitRuntimeSettingsWithFile("AccuracyFirstTemplate.json", CM_OVERWRITE);
50+
if (ret != DBR_OK) {
51+
cout << "Error" << endl;
52+
}
53+
}
54+
55+
void outputResults(TextResultArray* barcodeResults, CBarcodeReader& reader) {
56+
if (barcodeResults != NULL && barcodeResults->resultsCount > 0)
57+
{
58+
// Process each result in a loop
59+
for (int i = 0; i < barcodeResults->resultsCount; ++i)
60+
{
61+
cout << "Result " << (i + 1) << ":" << endl;
62+
63+
// Get format of each barcode
64+
if (barcodeResults->results[i]->barcodeFormat != BF_NULL)
65+
cout << " Barcode Format: " << barcodeResults->results[i]->barcodeFormatString << endl;
66+
else
67+
cout << " Barcode Format: " << barcodeResults->results[i]->barcodeFormatString_2 << endl;
68+
69+
// Get text result of each barcode
70+
cout << " Barcode Text: " << barcodeResults->results[i]->barcodeText << endl;
71+
}
72+
}
73+
else
74+
{
75+
cout << "No barcode detected." << endl;
76+
}
77+
78+
// Free the memory allocated for text results
79+
if (barcodeResults != NULL)
80+
CBarcodeReader::FreeTextResults(&barcodeResults);
81+
}
82+
};
83+
int main() {
84+
int errorCode = 0;
85+
char szErrorMsg[256];
86+
TextResultArray* barcodeResults = NULL;
87+
// Initialize license
88+
/*
89+
// By setting organization ID as "200001", a 7-day trial license will be used for license verification.
90+
// Note that network connection is required for this license to work.
91+
//
92+
// When using your own license, locate the following line and specify your Organization ID.
93+
// organizationID = "200001";
94+
//
95+
// If you don't have a license yet, you can request a trial from https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=samples&package=c_cpp
96+
*/
97+
DM_DLSConnectionParameters paramters;
98+
CBarcodeReader::InitDLSConnectionParameters(&paramters);
99+
paramters.organizationID = const_cast<char*>("200001"); // replace it with your organization ID
100+
errorCode = CBarcodeReader::InitLicenseFromDLS(&paramters, szErrorMsg, 256);
101+
if (errorCode != DBR_OK)
102+
{
103+
cout << szErrorMsg << endl;
104+
}
105+
// Create an instance of Barcode Reader
106+
CBarcodeReader reader;
107+
AccuracyFirstSettings af;
108+
109+
string fileName = "../../../../images/AllSupportedBarcodeTypes.png";
110+
111+
// Accuracy = The number of correctly decoded barcodes/the number of all decoded barcodes
112+
// There are two ways to configure runtime parameters. One is through PublicRuntimeSettings, the other is through parameters template.
113+
cout << "Decode through PublicRuntimeSettings:" << endl;
114+
{
115+
// config through PublicRuntimeSettings
116+
af.configAccuracyFirst(&reader);
117+
118+
// Decode barcodes from an image file by current runtime settings. The second parameter value "" means to decode through the current PublicRuntimeSettings.
119+
reader.DecodeFile(fileName.c_str(), "");
120+
121+
// Get all barcode results
122+
reader.GetAllTextResults(&barcodeResults);
123+
124+
// Output the barcode format and barcode text.
125+
af.outputResults(barcodeResults, reader);
126+
}
127+
cout << endl;
128+
cout << "Decode through parameters template:" << endl;
129+
{
130+
// config through parameters template
131+
af.configAccuracyFirstByTemplate(&reader);
132+
133+
// Decode barcodes from an image file by template.
134+
reader.DecodeFile(fileName.c_str(), "");
135+
136+
// Get all barcode results
137+
reader.GetAllTextResults(&barcodeResults);
138+
139+
// Output the barcode format and barcode text.
140+
af.outputResults(barcodeResults, reader);
141+
}
142+
cout << "Press any key to quit..." << endl;
143+
cin.ignore();
144+
return 0;
145+
};
146+
147+
148+
149+
150+
151+
152+
153+
154+

0 commit comments

Comments
 (0)