Commit Graph

4108 Commits

Author SHA1 Message Date
Stefan Weil
e0e29126ac unittest: Fix and enable scanutils_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-14 16:51:39 +02:00
Shree
6fa4587949 Allow saving of box/tiff pairs during base tesseract training 2019-06-14 09:35:39 +00:00
Shree
45cdf741ae Allow saving of box/tiff pairs during base tesseract training 2019-06-14 09:32:41 +00:00
Shree
832c6edb97 Allow saving of box/tiff pairs during base tesseract training 2019-06-14 09:25:54 +00:00
zdenop
3afc946d5e
Merge pull request #2492 from jbarlow83/fix-text2image
Fix text2image compilation on C++17 compilers
2019-06-14 07:45:14 +02:00
James R. Barlow
a9890afd12 Fix text2image compilation on C++17 compilers
C++17 drops support for `std::random_shuffle`, breaking C++17 compilers
that run to compile text2image.cpp. std::shuffle is valid on C++11
through C++17, so use std::shuffle instead.

Due to the use `std::random_shuffle`, `text2image --render_ngrams`
would not give consistent results for different compilers or platforms.
With the current change, the same random number generator is used for
all platforms and initialized to the same seed, so training output
should be consistent.
2019-06-13 16:07:20 -07:00
Stefan Weil
3c507100c6 unittest: Fix and enable ligature_table_test
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-11 16:40:23 +02:00
Egor Pugin
5717b098aa [sw] Remove inexistent include dirs. 2019-06-08 17:45:37 +03:00
Egor Pugin
c570772bce [sw] Exclude missing include dir. 2019-06-08 17:41:02 +03:00
Egor Pugin
17c8ac29a2
Update appveyor.yml 2019-06-06 13:31:55 +03:00
Egor Pugin
421e3e44cb Update sw script. 2019-06-06 00:56:12 +03:00
zdenop
5e62d02230 cmake: using c++ standard for g++ 2019-06-01 21:49:30 +02:00
Stefan Weil
b9a31eca37 Revert "Do not hardcode c++11 for unix builds"
This reverts commit 4348793bd5.
It is needed for Travis CI based on Ubuntu Trusty.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-06-01 17:42:24 +02:00
zdenop
359f3c555d
Merge pull request #2477 from ismail/master
Fix OpenMP builds on Unix
2019-05-31 15:42:06 +02:00
İsmail Dönmez
ab28df7448
Fix OpenMP builds on Unix 2019-05-31 14:18:26 +02:00
İsmail Dönmez
4348793bd5 Do not hardcode c++11 for unix builds 2019-05-31 14:11:11 +02:00
İsmail Dönmez
5df58fc979 Detect and use C++17 support for CMake builds 2019-05-31 14:11:11 +02:00
zdenop
ee2d7172b7
Merge pull request #2475 from stweil/std
Add dot product implementation using std::inner_product
2019-05-31 13:31:57 +02:00
zdenop
7b87389e54
Merge pull request #2474 from stweil/c++
Use C++17 compiler if possible
2019-05-31 13:31:29 +02:00
zdenop
a1df37bc8f
Merge pull request #2473 from Shreeshrii/master
Update documentation for unicharset_extractor
2019-05-31 13:30:51 +02:00
Stefan Weil
fefd521a49 Add dot product implementation using std::inner_product
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-31 12:07:17 +02:00
Stefan Weil
ca885da5d3 Use C++17 compiler if possible
This allows using new features of C++17 conditionally.
Simplify also the code which checks and sets the C++ version.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-31 10:40:56 +02:00
Shree
00abf57d02 Update documentation for unicharset_extractor 2019-05-31 08:20:19 +00:00
zdenop
7d3e1324a8 fix packaging appveyor artifacts 2019-05-29 08:39:56 +02:00
Stefan Weil
e0c2f0a782 Fix crash in PreloadRenderers with nullptr outputbase
The crash could be triggered by a wrong command line.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-29 07:46:29 +02:00
Stefan Weil
9a4bd041c8 Fix build for unittests
Commit 29f2cff203 was the wrong fix
for the compiler warnings because it broke the unittest build.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 21:36:34 +02:00
Egor Pugin
4db6b9ebc6
Merge pull request #2466 from stweil/warnings
Fix more compiler warnings (mostly unused macros, unused methods)
2019-05-26 22:06:28 +03:00
Stefan Weil
2c23e7ead5 scanedg: Add const attributes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 20:27:21 +02:00
Stefan Weil
9551c3d413 unittest: Remove unused methods
This fixes compiler warnings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 20:27:21 +02:00
Stefan Weil
4b3bbd908a Remove EXTERN macro
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 20:27:21 +02:00
Stefan Weil
ac999b2409 Remove unused macros
This fixes compiler warnings from clang++ like these ones:

    src/ccutil/params.cpp:34:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:67:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:68:9: warning: macro is not used [-Wunused-macros]
    src/cutil/oldlist.cpp:78:9: warning: macro is not used [-Wunused-macros]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 20:27:21 +02:00
zdenop
39715629fb
Merge pull request #2465 from stweil/warnings
Fix compiler warnings [-Wmissing-variable-declarations]
2019-05-26 19:50:39 +02:00
Stefan Weil
3c9691f286 configure: Fix cross builds (check for TensorFlow header)
AC_CHECK_FILE does not work in cross builds. Such builds aborted.
Replace it by AC_CHECK_HEADERS. This fixes cross builds.

To enable TensorFlow in cross builds, more work is needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 17:46:44 +02:00
Stefan Weil
8c8eb21bc5 Fix compiler errors for old gcc
Travis CI with gcc 4.8 failed with errors.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 15:38:40 +02:00
Stefan Weil
a86143a41d Remove some unused functions, constants and variables
This fixes compiler warnings, for example:

    src/ccutil/strngs.cpp:36:11: warning: unused variable 'kMaxDoubleSize' [-Wunused-const-variable]
    src/viewer/svutil.cpp:320:13: warning: unused function 'TessFreeAddrInfo' [-Wunused-function]
    src/ccstruct/werd.cpp:32:19: warning: unused variable 'CANT_SCALE_EDGESTEPS' [-Wunused-const-variable]
    src/textord/bbgrid.cpp:103:10: warning: unused variable 'old_tright' [-Wunused-variable]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 11:52:31 +02:00
Stefan Weil
29f2cff203 training: Add missing static attributes
That fixes several warnings from clang++ like the following one:

    src/training/combine_lang_model.cpp:36:1: warning: no previous extern declaration for non-static variable 'FLAGS_lang_is_rtl' [-Wmissing-variable-declarations]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 11:33:52 +02:00
Stefan Weil
a139d553a7 training: Move declarations from cpp files to h file
That fixes several warnings from clang++ like the following one:

    src/training/commontraining.cpp:95:1: warning: no previous extern declaration for non-static variable 'FLAGS_D' [-Wmissing-variable-declarations]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 08:53:09 +02:00
Stefan Weil
389285010c featdefs: Add missing include statement
It is needed for PicoFeatureLength. This fixes a compiler warning.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 08:53:09 +02:00
Stefan Weil
4bec4a69a0 Add missing static attributes
This fixes lots of compiler warnings like these ones:

    src/api/baseapi.cpp:113:13: warning: no previous extern declaration for non-static variable 'kInputFile' [-Wmissing-variable-declarations]
    src/api/baseapi.cpp:117:13: warning: no previous extern declaration for non-static variable 'kOldVarsFile' [-Wmissing-variable-declarations]
    src/api/baseapi.cpp:97:10: warning: no previous extern declaration for non-static variable 'stream_filelist' [-Wmissing-variable-declarations]
    src/ccmain/equationdetect.cpp:46:10: warning: no previous extern declaration for non-static variable 'equationdetect_save_bi_image' [-Wmissing-variable-declarations]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 08:53:09 +02:00
Stefan Weil
7e7811ff92 bits16: Modernize code
This also fixes warnings like the following one from clang++:

    src/ccmain/pgedit.cpp:114:15: warning: declaration requires a global constructor [-Wglobal-constructors]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-26 08:53:08 +02:00
zdenop
3b210ec059
Merge pull request #2464 from rrrapha/librt
Do not link librt on OpenBSD
2019-05-25 18:44:41 +02:00
zdenop
12847d58ad
Merge pull request #2455 from bact/master
Unittest: Fix Thai valid text and add Thai illegal sequences
2019-05-25 18:36:17 +02:00
Raphael Graf
dacba02cd8 Do not link librt on OpenBSD 2019-05-25 18:08:55 +02:00
Stefan Weil
334d9b4633 unicodes: Optimize code by using constexpr and removing unused globals
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-25 14:51:28 +02:00
Stefan Weil
23d05a5e1b featdefs: Optimize code by using constexpr
This also fixes some warnings from clang++:

    src/classify/featdefs.cpp:47:15: warning: declaration requires a global constructor [-Wglobal-constructors]
    src/classify/featdefs.cpp:57:15: warning: declaration requires a global constructor [-Wglobal-constructors]
    src/classify/featdefs.cpp:66:15: warning: declaration requires a global constructor [-Wglobal-constructors]
    src/classify/featdefs.cpp:75:15: warning: declaration requires a global constructor [-Wglobal-constructors]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-25 14:46:36 +02:00
Stefan Weil
7628112273 Fix broken build for Leptonica < 1.77
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-25 14:23:43 +02:00
Stefan Weil
55901a480f Remove classify/cutoffs.h
It only defined CLASS_CUTOFF_ARRAY and some unused definitions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2019-05-25 13:54:44 +02:00
zdenop
82458db630 Merge branch 'master' of https://github.com/tesseract-ocr/tesseract 2019-05-25 11:14:28 +02:00
zdenop
539673b503 fix '--enable-visibility' build 2019-05-25 11:13:33 +02:00
zdenop
8de022ab1c
Merge pull request #2461 from stweil/tensorflow
Support build with Tensorflow
2019-05-25 10:52:37 +02:00