Commit Graph

103 Commits

Author SHA1 Message Date
Stefan Weil
4df822a3fc
Revert "Merge pull request #3330 from Sintun/master" (#3505)
This reverts commit 122daf1d64, reversing
changes made to 4cd56dc5f5.

Those changes caused two regressions which resulted in an assertion
or a segmentation fault.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-07-22 09:04:23 +03:00
Amit Dovev
c24538518c ThresholdMethod::TiledSauvola -> ThresholdMethod::Sauvola
The fact that this method uses tiles is implementation detail. It does not change the result compared to Sauvola without tiles. The use of tiles minimize memory consumption.
2021-05-21 18:15:30 +03:00
Egor Pugin
43747d6ea8 Postfix for #3418. 2021-05-10 15:06:27 +03:00
Amit Dovev
21e76c7a13 Convert enum ThreshMethod to enum class 2021-05-09 18:49:09 +03:00
Amit Dovev
11c73c9481 Add more binarization options
Use functions from Leptonica to provide more binarization options. The new options are: 1) Adaptive Otsu and 2) Sauvola (Tiled) .
2021-05-07 16:48:26 +03:00
Ger Hobbelt
bd8adff829 fix compile error: PrintFontsTable() is for legacy builds only
# Conflicts:
#	googletest
2021-04-29 23:27:20 +02:00
Lucas Cimon
b852d658cb Adding --print-fonts-table parameter & tessedit_font_id configuration option 2021-04-29 11:25:40 +02:00
Stefan Weil
0401b9470c Fix some typos (most found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-11 11:06:36 +02:00
Stefan Weil
63f4463028 Add const attribute to some functions (API change)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-08 10:43:21 +02:00
Stefan Weil
7fe5248d91 Format public API files with modified rules for clang-format
Disable clang-format for version.h.in because it destroys
several macro definitions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-07 18:53:48 +02: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
7bada4e629 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 Brechtken
5e8c8c2b4d conflict merge, removing an unnecessary include 2021-03-16 23:47:43 +01:00
Egor Pugin
4cd56dc5f5
Fix build system macro. Fixes #3334. 2021-03-17 01:26:56 +03:00
Stefan Brechtken
e10d19b084 updating function documentation and removing unnecessary include 2021-03-15 17:25:10 +01:00
Stefan Brechtken
594a000ecd merging with tesseract master in order to create a pull request 2021-03-15 17:02:19 +01:00
Egor Pugin
efd17e205a Replace typedef structs with structs.
typedef enums are left intact.
2021-03-15 09:47:04 +03:00
Egor Pugin
f06b2c7c8d [capi] Restore some of wrongly removed apis.
Removed C++ APIs are not restored.
Additionally remove unused C++ typedefs which were in removed C++ functions.
If you still need them, use C++ API instead.
2021-03-14 17:20:52 +03:00
Egor Pugin
dabdaa1def Misc. 2021-03-14 17:14:41 +03:00
Egor Pugin
0eb7ba88bf [clang-format] Execute clang format on include and src dirs.
Script:
find include src -type f | sort > all.txt
find include src -type f | grep -v "\.cpp" | grep -v "\.h" | sort > skip.txt
comm -23 all.txt skip.txt | xargs clang-format -i
2021-03-12 22:35:02 +03:00
Egor Pugin
0e9deb68c9 Revert "Format public API files with 'clang-format-11 -i include/tesseract/*.h'"
This reverts commit c20da5e10f.
2021-03-12 20:20:34 +03:00
Stefan Weil
c20da5e10f Format public API files with 'clang-format-11 -i include/tesseract/*.h'
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-03-12 13:26:38 +01:00
Egor Pugin
fd8907471c Improve C API. Add tests.
1. Add simple C API test in C++ program.
2. Add simple C API test in C program.
3. Fix including capi.h in C++ files.
2021-01-02 03:57:25 +03:00
Egor Pugin
6740e88549 [capi] Reorder headers in capi.h. Put our header before standard ones. 2021-01-02 03:00:49 +03:00
Egor Pugin
bee90f7835 [capi] Remove unused functions.
Those functions were undef ifdef for C++ mode. Since in C++ mode noone uses them, they can be safely removed.
2021-01-02 02:59:31 +03:00
Egor Pugin
52f5e5b8fb Restore building of C API. Simplify.
1. Delete useless ifdefs.
2. Move C++ includes into source file. C code does not care about any C++ headers.
3. Replace TESS_CAPI_INCLUDE_BASEAPI with simple __cplusplus macro.
4. In capi.cpp remove enclosing namespace tesseract, so symbols have their according decls back.

In capi.cpp we
- put capi.h after all C++ headers, so we can remove some typedefs later,
- put using namespace tesseract between them, so C++ symbols are visible to functions in the file without namespace.
2021-01-02 02:53:33 +03:00
Egor Pugin
664a718a63 Rename platform.h to export.h. 2021-01-01 00:18:36 +03:00
Stefan Weil
d4df4c06fc Add missing definition for TESS_API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-12-31 17:06:21 +01:00
Egor Pugin
c86325e2f7 Use TESS_API for every public symbol. Public symbol is exported from the library. This also applies to unit test and training symbols. Users will be limited to public api, but set of exported symbols will be wider still.
Remove TESS_LOCAL.
Fix several symbol issues that made visible with these changes.

All build systems must set -fvisibility-hidden for *nix systems.
2020-12-31 16:32:29 +03:00
Stefan Weil
fc4002dda8 Remove helpers.h from public API
Remove also outdated references to apitypes.h which no longer exists.

Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-31 09:06:16 +01:00
Egor Pugin
ff1a995bfc Removed unused fwd decl. 2020-12-31 02:45:55 +03:00
Egor Pugin
a7246865fc Remove unused fwd decls. 2020-12-31 02:43:24 +03:00
Egor Pugin
67218eeb99 Remove unused typedefs. 2020-12-31 02:41:26 +03:00
Egor Pugin
1f834b7f27 Remove unused fwd decl. 2020-12-31 02:39:45 +03:00
Egor Pugin
b01f151027 Remove comment. 2020-12-31 02:39:04 +03:00
Egor Pugin
3af30419db Move MAX_PATH def out from public header. 2020-12-31 02:35:28 +03:00
Egor Pugin
2252936fc8 Use linear congruential random number generator from C++11. 2020-12-31 02:31:53 +03:00
Egor Pugin
a0509b2feb Use std::swap instead of manual function. 2020-12-31 02:17:54 +03:00
Egor Pugin
89273c915d Remove empty DLLSYM macro. 2020-12-31 02:10:46 +03:00
Egor Pugin
8bd1227c3e Remove public empty header. 2020-12-31 02:05:47 +03:00
Stefan Weil
faf0407dff Remove RecognizeForChopTest from public API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-12-30 17:55:40 +01:00
Stefan Weil
d1d176a280 Remove TessTruthCallback from public API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-12-30 15:44:44 +01:00
Stefan Weil
588ac3fed2 Remove TessTruthCallback from public API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-12-30 15:38:11 +01:00
Stefan Weil
deec8ef46f Replace std::list by std::vector
Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-30 07:10:29 +01:00
Stefan Weil
f4e380f64a Remove serialis.h from public API
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-12-29 11:28:50 +01:00
Stefan Weil
90af3e7b5c Remove strngs.h from public API
Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-28 21:03:29 +01:00
Stefan Weil
03884c370c Replace STRING by std::string in ResultIterator
Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-28 21:03:29 +01:00
Stefan Weil
a007cbeb57 Replace STRING by std::string
Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-28 21:03:29 +01:00
Stefan Weil
d37a9319ec Remove unused TessBaseAPIInit from capi.h
Signed-off-by: Stefan Weil <sw@weil.de>
2020-12-28 21:03:29 +01:00