Commit Graph

3210 Commits

Author SHA1 Message Date
Jaroslaw Kubik
e6c9967b83 Fixed a typo in progres monitor C API
TessMonitorcDelete -> TessMonitorDelete
2018-06-01 19:42:28 +02:00
Jaroslaw Kubik
e254c9fa38 Return a value from default progress report function
The progress reporting function returns a boolean. The returned
value is never used by the tesseract and its meaing is not
documented, which renders the value meaningless. Still, lack of
return should not be premitted.
2018-05-30 10:44:13 +02:00
Jaroslaw Kubik
8f6242fd4f Fixed a typo in the C API progress monitor 2018-05-30 00:22:06 +02:00
Jaroslaw Kubik
87d33b6c9e Add progress monitoring C api
The C API is missing the ability to monitor the progress of the
recognition. This patch adds C wrappers to the progress monitor
that allow monitoring the progress and canceling the recognition
process early.
2018-05-29 23:26:41 +02:00
Jaroslaw Kubik
217e5e5881 Add a context-aware progress monitor pointer
The progress_callback field in the ETEXT_DESC monitor type does not
take any 'context' parameter, which may make implementing callback
functions difficult and may require use of global variables.
The new function receives the ETEXT_DESC pointer as an argument.
This makes it possible to share the cancel_this field as context
carrier if required.
The change is backwards-compatible: the old pointer remains as a
member of the class, and the default value for the new pointer is
a function calling the classic progress notifier. This way the code
unaware of the new member will continue to work as before.
2018-05-29 21:48:51 +02:00
Egor Pugin
8d3f8111f3
Try to fix VS2015 appveyor builds. 2018-05-29 19:19:12 +03:00
Egor Pugin
0c50ae3a9c Fix windows build. 2018-05-29 19:15:01 +03:00
Egor Pugin
15f36de0f7
Update appveyor.yml 2018-05-29 14:01:18 +03:00
zdenop
7bc8255e04
Merge pull request #1610 from stweil/typo
Fix some typos (most found by codespell)
2018-05-27 19:01:40 +02:00
Stefan Weil
509a6f0ce0 Fix some typos (most found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-27 18:49:43 +02:00
Egor Pugin
420a4ed223
Merge pull request #1608 from ZaMaZaN4iK/patch-1
Remove unused variable
2018-05-26 22:35:28 +03:00
Alexander
a2e72f258a
Remove unused variable 2018-05-26 22:20:45 +03:00
Egor Pugin
83019bdcd3
Merge pull request #1595 from ZaMaZaN4iK/fix_smart_pointers
Use std::unique_ptr instead of manual memory management.
2018-05-26 19:20:03 +03:00
Egor Pugin
2bdf817999
Merge pull request #1607 from stweil/reformat
Add configuration for clang-format-6.0 and clang-format 7
2018-05-26 12:11:42 +03:00
Stefan Weil
d7db470893 Simplify configuration for clang-format
Instead of using a detailed configuration, use Google base style and
add the extras.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-26 10:09:57 +02:00
Alexander
69fbb52930
Merge branch 'master' into fix_smart_pointers 2018-05-26 00:37:07 +03:00
Stefan Weil
544d399f08 Update configuration for clang-format
Don't derive the pointer alignment. Always use left alignment.
Remove also spaces at line endings.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-24 20:23:23 +02:00
Stefan Weil
d55e4e5a59 Add configuration for clang-format 7
It is based on Google style:
clang-format-7 -i -style=Google -dump-config >.clang-format

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-24 20:21:54 +02:00
Egor Pugin
5a56d0c291
Merge pull request #1588 from ZaMaZaN4iK/fix_own_bool
Use standard bool instead of BOOL8.
2018-05-23 16:53:12 +03:00
Egor Pugin
78857cab8b
Merge pull request #1591 from ZaMaZaN4iK/fix_default_two
Use default keyword instead of empty ctors/dtors.
2018-05-22 21:59:48 +03:00
Alexander Zaitsev
58e8538138 Add more std::unique_ptr 2018-05-22 17:55:45 +03:00
Alexander Zaitsev
df49d470ca Use std::unique_ptr instead of manual memory management. 2018-05-22 14:36:37 +03:00
zdenop
555f6ffc01
Merge pull request #1593 from stweil/fix
Fix compilation with g++-5
2018-05-21 22:11:34 +02:00
Stefan Weil
cdf035d9b1 Fix compilation with g++-5
Commit 0248c7ff9d replaced math.h by cmath.
Therefore isinf and isnan are no longer declared.
Replace them by their C++ 11 variant.

Signed-off-by: Stefan Weil <stweil@ub-blade-02.bib.uni-mannheim.de>
2018-05-21 22:09:48 +02:00
Alexander Zaitsev
d14a7ca043 Use default keyword instead of empty ctors/dtors. Add more default. 2018-05-21 14:11:03 +03:00
Alexander Zaitsev
785b5e8134 Use default keyword instead of empty ctors/dtors. 2018-05-21 13:35:46 +03:00
zdenop
0a93ad2aae
Merge pull request #1590 from mduk/patch-1
Update README.md
2018-05-21 11:26:59 +02:00
Daniel Kendell
b4b33dda2a
Update README.md
Fixed links to C and C++ API header files.
2018-05-21 09:16:42 +01:00
Egor Pugin
e9197f30f3
Merge pull request #1589 from stweil/fix
ColPartition: Add missing initialisation for median_left, median_right
2018-05-21 01:28:00 +03:00
Alexander Zaitsev
abca191293 Add missing file change. 2018-05-21 00:43:22 +03:00
Alexander Zaitsev
6ff0b56597 More fixes BOOL8 -> bool 2018-05-21 00:40:58 +03:00
Stefan Weil
fedae91482 ColPartition: Add missing initialisation for median_left, median_right
The following code caused a crash when Tesseract was compiled with -ftrapv:

1259	  int width = right - left;

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff665c231 in __GI_abort () at abort.c:79
#2  0x00007ffff69e34d8 in __subvsi3 () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3  0x000055555560c1c5 in tesseract::ColPartitionGrid::FindVPartitionPartners (this=0x55555717e3c0, to_the_left=true, part=0x5555571fa380)
    at ../../../src/textord/colpartitiongrid.cpp:1259
#4  0x000055555560bda0 in tesseract::ColPartitionGrid::FindPartitionPartners (this=0x55555717e3c0) at ../../../src/textord/colpartitiongrid.cpp:1196
#5  0x00005555555f52b6 in tesseract::ColumnFinder::FindBlocks (this=0x55555717e280, pageseg_mode=tesseract::PSM_AUTO, scaled_color=0x0, scaled_factor=-1,
    input_block=0x555555f91390, photo_mask_pix=0x555555f73300, thresholds_pix=0x555555f76290, grey_pix=0x555555f762e0, pixa_debug=0x7ffff7fc88d8, blocks=0x7fffffffd250,
    diacritic_blobs=0x7fffffffd330, to_blocks=0x7fffffffd328) at ../../../src/textord/colfind.cpp:431
#6  0x00005555555c240d in tesseract::Tesseract::AutoPageSeg (this=0x7ffff7fa5010, pageseg_mode=tesseract::PSM_AUTO, blocks=0x555555f761d0, to_blocks=0x7fffffffd328,
    diacritic_blobs=0x7fffffffd330, osd_tess=0x0, osr=0x7fffffffd6d0) at ../../../src/ccmain/pagesegmain.cpp:229
#7  0x00005555555c1ffd in tesseract::Tesseract::SegmentPage (this=0x7ffff7fa5010, input_file=0x555555f7bd90, blocks=0x555555f761d0, osd_tess=0x0, osr=0x7fffffffd6d0)
    at ../../../src/ccmain/pagesegmain.cpp:141
#8  0x0000555555582540 in tesseract::TessBaseAPI::FindLines (this=0x555555a9a580 <main::api>) at ../../../src/api/baseapi.cpp:2291
#9  0x000055555557ce42 in tesseract::TessBaseAPI::Recognize (this=0x555555a9a580 <main::api>, monitor=0x0) at ../../../src/api/baseapi.cpp:802

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-20 23:39:18 +02:00
Alexander Zaitsev
6f580bad77 Add miss changes to bool fixes. 2018-05-20 23:04:03 +03:00
Alexander Zaitsev
a040bc2da5 Use standard bool instead of BOOL8. 2018-05-20 22:46:46 +03:00
zdenop
7c8ab18407
Merge pull request #1587 from stweil/clean
Remove last "register" related code
2018-05-20 21:10:28 +02:00
Stefan Weil
c749d4619f Update build rules for Android
As the "register" keyword is now no longer used by the Tesseract code,
the compiler option -Wno-error=deprecated-register can be removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-20 20:50:23 +02:00
Stefan Weil
bb34351fdb Remove remaining deprecated "register" keyword
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-05-20 20:49:08 +02:00
Egor Pugin
a80a8f17bb
Merge pull request #1585 from ZaMaZaN4iK/small_fixes
RFC: Refactor code
2018-05-20 21:24:07 +03:00
Alexander Zaitsev
6e568b027c Merge remote-tracking branch 'my_repo/small_fixes' into small_fixes 2018-05-20 18:48:50 +03:00
Alexander Zaitsev
6049225d01 Merge remote-tracking branch 'my_repo/small_fixes' into small_fixes 2018-05-20 18:48:30 +03:00
Alexander Zaitsev
3ce2cab742 Merge remote-tracking branch 'my_repo/small_fixes' into small_fixes 2018-05-20 17:50:29 +03:00
Alexander Zaitsev
d54d7486b4 Use std::max/std::min instead of MAX/MIN macros. 2018-05-20 17:49:48 +03:00
Alexander Zaitsev
14ae0b8727 Use std::max/std::min instead of MAX/MIN macros. 2018-05-20 16:18:07 +03:00
Alexander Zaitsev
c34e145b1a Use numeric_limits instead of INT_MAX. 2018-05-20 14:49:35 +03:00
Alexander Zaitsev
7d08e117d8 Added more const. 2018-05-20 14:21:07 +03:00
Alexander Zaitsev
e7e8e20119 Remove deprecated in C++11 'register' keyword (removed since C++17). 2018-05-20 01:49:26 +03:00
Alexander Zaitsev
a50b966af5 Added more const and one small fix. 2018-05-20 01:43:43 +03:00
Alexander Zaitsev
0697235bb2 Use using instead of typedef. Reason: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rt-using 2018-05-20 01:31:03 +03:00
Alexander Zaitsev
0248c7ff9d Rename all C-style headers (e.g. <stdio.h>) to C++ style (<cstdio>). 2018-05-20 00:52:04 +03:00
Alexander Zaitsev
96f8f853c8 Small enhancements (adding const, etc.) 2018-05-19 23:07:28 +03:00