Commit Graph

1643 Commits

Author SHA1 Message Date
Stefan Weil
b15b5d1de7 Replace malloc / free by new / delete for FEATURE_STRUCT, FEATURE_SET_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-28 12:12:18 +02:00
Stefan Weil
aa8dda89a3 Replace malloc / free by new / delete for CHAR_DESC_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 18:43:14 +01:00
Stefan Weil
0f90ccb9cd Replace malloc / free by new / delete for CHISTRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 16:45:14 +01:00
Stefan Weil
0a46866bcd Replace malloc / free by new / delete for PERM_CONFIG_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 16:19:40 +01:00
Stefan Weil
92359a4a11 Replace malloc / free by new / delete for TEMP_CONFIG_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 15:59:28 +01:00
Stefan Weil
fdf4539769 Replace malloc / free by new / delete for ADAPT_CLASS_STRUCT
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 13:49:57 +01:00
Stefan Weil
0a0a3e1946 Replace malloc / free by new / delete
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 13:00:18 +01:00
Stefan Weil
884a28b366 Fix some compiler warnings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 13:00:18 +01:00
Stefan Weil
77514d693f Modernize BitVector
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-27 13:00:18 +01:00
Stefan Weil
0f72e0fdb3 Simplify checks for emptiness
Replace the patterns (x.size() == 0) and (x.length() == 0) by x.empty().

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-26 23:22:50 +01:00
Egor Pugin
067c971774 Misc. 2021-03-24 14:36:45 +03:00
Egor Pugin
7c975a0eee Remove default locale setting in debug config. Any locale errors must be fixed separately (if any).
Fixes #3290.
2021-03-24 14:36:40 +03:00
Stefan Weil
595346d548 Replace some snprintf by std::to_string and modernize more code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-24 08:01:59 +01:00
Stefan Weil
2048f328e0 Suppress output of page number for TIFF files with a single image
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-23 18:25:15 +01:00
Stefan Weil
264dfb3685 Don't convert for loop after '#pragma omp parallel' with clang-tidy
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-23 15:48:59 +01:00
Stefan Weil
1205f036ea Remove TessBaseAPI::SetThresholder (API change)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-23 08:59:04 +01:00
Stefan Weil
7d70ed4b41 Modernize code for OTSU and reduce public API further
Remove thresholder.h from the public API.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-23 08:59:04 +01:00
Stefan Weil
ef645ce334 Avoid lots of messages for training with single line images
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 16:06:30 +01:00
Egor Pugin
7677b80408
Merge pull request #3355 from eighttails/output_training_command_line
Print command line options if run_command() failed.
2021-03-22 15:13:31 +03:00
Tadahito Yao
3b436a72c5 Print command line options if run_command() failed. 2021-03-22 20:46:44 +09:00
Stefan Weil
67dcbdda2f Fix some compiler warnings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 10:36:38 +01:00
Stefan Weil
4530763329 Fix some compiler warnings
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:15:09 +01:00
Stefan Weil
fbaac9dc9d Modernize code (clang-tidy -checks='-*,google-readability-braces-around-statements')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:03:51 +01:00
Stefan Weil
a54dc6390d Modernize code (clang-tidy -checks='-*,modernize-use-auto')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:57 +01:00
Stefan Weil
77ed2886a7 Modernize code (clang-tidy -checks='-*,modernize-loop-convert')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:51 +01:00
Stefan Weil
d4d51910e1 Add braces to single line statements (clang-tidy -checks='-*,google-readability-braces-around-statements')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-22 09:02:13 +01:00
Stefan Weil
5384aa7b21 Modernize code (clang-tidy -checks='-*,modernize-use-equals-delete')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:56 +01:00
Stefan Weil
406233f1ae Modernize code (clang-tidy -checks='-*,modernize-use-equals-default')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:56 +01:00
Stefan Weil
27293fad62 Modernize code (clang-tidy -checks='-*,modernize-use-emplace')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:55 +01:00
Stefan Weil
6fc31c44f8 Modernize code (clang-tidy -checks='-*,modernize-use-bool-literals')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:55 +01:00
Stefan Weil
35e143ddfc Modernize code (clang-tidy -checks='-*,modernize-use-auto')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:55 +01:00
Stefan Weil
1439efa734 Modernize code (clang-tidy -checks='-*,modernize-make-unique')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:55 +01:00
Stefan Weil
02774bda6e Modernize code (clang-tidy -checks='-*,modernize-loop-convert')
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 21:45:55 +01:00
Stefan Weil
719dc1d7da Modernize code using override
The modifications were made using this command:

run-clang-tidy -header-filter='.*' -checks='-*,modernize-use-override' -fix

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 20:06:38 +01:00
Stefan Weil
187ac4136a Fix LGTM alert (local variable hides a parameter)
LGTM alert:

    Local variable 'correct_text' hides a parameter of the same name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 18:20:13 +01:00
Egor Pugin
7d17b72ba5 Use more smart pointers. 2021-03-21 15:19:21 +03:00
Stefan Weil
0c20d3f843 Fix compiler warnings (mostly -Wsign-compare)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-21 09:29:34 +01:00
Stefan Weil
55d87f642c Disable most Leptonica messages for tesseract by default
They were disabled in earlier builds which used NDEBUG, too.

Allow manual setting of the Leptonica message level
with environment variable LEPT_MSG_SEVERITY.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 20:16:16 +01:00
Stefan Weil
19afcdb79b Remove unused function UnicharIdArrayUtils::find_in
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 15:51:28 +01:00
Stefan Weil
7af5b75b8f Disable unused WriteMemoryCallback if libcurl is not used
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 15:49:06 +01:00
Egor Pugin
db7a977eab Use smart pointers. 2021-03-20 16:04:45 +03:00
Egor Pugin
69ab5bbf65 Misc. 2021-03-20 16:04:00 +03:00
Stefan Weil
f176e7c274 Fix double free caused by commit f33e80e (fixes issue #3348)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 12:37:56 +01:00
Stefan Weil
87b0a4de97 Rename GenericVector::get
The new name GenericVector::at is compatible with standard containers.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 09:42:19 +01:00
Stefan Weil
2c1c09bd6a Rename UnicityTable::get, UnicityTable::get_mutable
The new name UnicityTable::at is compatible with standard containers.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 09:40:00 +01:00
Stefan Weil
883353df63 Replace std::array by std::vector to avoid stack overflow
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 09:39:16 +01:00
Stefan Weil
ec2c989d00 Modernize code in src/classify
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-20 09:06:40 +01:00
Stefan Weil
54aec32586 Replace remaining PointerVector by std::vector for src/lstm
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-19 22:22:04 +01:00
Stefan Weil
0d739530a5 Remove unused PointerVector::DeSerialize, PonterVector::DeSerializeElement
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-19 21:53:17 +01:00
Stefan Weil
7207cf13d7 Replace more PointerVector by std::vector for src/ccstruct
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-19 21:53:08 +01:00