Skip to content

Commit e2da695

Browse files
committed
ZXingReader: add experimental -denoise command line option
1 parent b426123 commit e2da695

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

example/ZXingReader.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static void PrintUsage(const char* exePath)
6060
#ifdef ZXING_EXPERIMENTAL_API
6161
<< " -symbol Print the detected symbol (if available)\n"
6262
<< " -json Print a complete JSON formated serialization\n"
63+
<< " -denoise Use extra denoiseing (closing operation)\n"
6364
#endif
6465
<< " -bytes Write (only) the bytes content of the symbol(s) to stdout\n"
6566
<< " -pngout <file name>\n"
@@ -76,23 +77,20 @@ static void PrintUsage(const char* exePath)
7677

7778
static bool ParseOptions(int argc, char* argv[], ReaderOptions& options, CLI& cli)
7879
{
79-
#ifdef ZXING_EXPERIMENTAL_API
80-
options.setTryDenoise(true);
81-
#endif
82-
8380
for (int i = 1; i < argc; ++i) {
8481
auto is = [&](const char* str) { return strlen(argv[i]) > 1 && strncmp(argv[i], str, strlen(argv[i])) == 0; };
8582
if (is("-fast")) {
8683
options.setTryHarder(false);
87-
#ifdef ZXING_EXPERIMENTAL_API
88-
options.setTryDenoise(false);
89-
#endif
9084
} else if (is("-norotate")) {
9185
options.setTryRotate(false);
9286
} else if (is("-noinvert")) {
9387
options.setTryInvert(false);
9488
} else if (is("-noscale")) {
9589
options.setTryDownscale(false);
90+
#ifdef ZXING_EXPERIMENTAL_API
91+
} else if (is("-denoise")) {
92+
options.setTryDenoise(true);
93+
#endif
9694
} else if (is("-single")) {
9795
options.setMaxNumberOfSymbols(1);
9896
} else if (is("-ispure")) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy