Commit Graph

4864 Commits

Author SHA1 Message Date
Stefan Weil
fe76142a3d Remove GenericVector::scale() again
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-10-28 16:24:59 +01:00
zdenop
5761880676
Merge pull request #3141 from stweil/invert
Modify OCR for inverted text
2020-10-27 08:57:21 +01:00
Stefan Weil
eaf72ace31 Prefer result from inverted image if the mean confidence is better
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-10-26 20:37:47 +01:00
Stefan Weil
cfb1fb2540 Try OCR on inverted line only if mean confidence is below 50 %
The old code looked for the minimum confidence which triggered
very often a 2nd OCR without improving the result.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-10-26 09:32:09 +01:00
zdenop
11297c983e
Merge pull request #3130 from robinwatts/pushback15
Tweak SIMDDetect for ANDROID Neon.
2020-10-19 18:21:00 +02:00
Robin Watts
436008bd37 Tweak SIMDDetect for ANDROID Neon.
cpufeatures.h should be cpu-features.h, with the latest NDK
at least. The #if 0'd section is not required because armv8
always includes NEON.
2020-10-19 12:04:29 +01:00
zdenop
514a7893f4
Merge pull request #2994 from robinwatts/pushback11
Improve speed of tesseract by optimising for intSimdMatrix case
2020-10-17 17:19:49 +02:00
acoder77
ac661414b5
Create .gitattributes for cross os contributors
With this set, Windows users will have text files converted from Windows style line endings (\r\n) to Unix style line endings (\n) when they’re added to the repository.
https://www.edwardthomson.com/blog/git_for_windows_line_endings.html
2020-10-17 11:23:42 +05:30
Robin Watts
db10c7b577 intsimdmatrixneon.cpp: Do biasing in SIMD. 2020-10-12 04:30:46 -07:00
Robin Watts
d1e49d6dd2 intsimdmatrixavx2: Do biasing in SIMD.
We also move to relying on both scales and output having been
padded to accomodate us writing more results than are actually
needed here. This was allowed for a few commits back.
2020-10-12 04:30:46 -07:00
Robin Watts
872816897a Rejig intsimdmatrix to reduce FP ops.
Avoid 1) floating point division by 127, 2) conversion of
bias to double, 3) FP addition, in favour of 1) integer
multiplication by 127, and 2) integer addition.

(Also costs extra work in the serialisation/deserialisation of
the scale values, and conversion of weights to int formats, but
these are all one offs).
2020-10-12 04:30:46 -07:00
Robin Watts
aba1800f69 Round output buffers for intSimdMatrix.
In order to allow intSimdMatrix implementations to 'overwrite'
their outputs, ensure that the output buffers are always padded
to the next block size.

This doesn't make any difference yet, but it enables optimisations
further down the line, especially when the biasing is pulled into
the SIMD.
2020-10-12 11:47:16 +01:00
Robin Watts
9dfdac51c6 Tweak scales array for intSimdMatrix case.
Currently, the size of the scales array is not rounded up
in the same way as the weights are. This blocks us pushing
the scale calculations into the SIMD, as when we "overread"
the end of the scale array, we potentially get errors.

Here, we adjust the intSimdMatrix stuff to ensure that the
scales array reserves enough entries to allow such overreads
to work.

This doesn't make any difference for now, but opens the way
for future optimisations.
2020-10-12 11:47:16 +01:00
Shatur95
5a377707e0 Generate imported target automatically 2020-10-12 11:47:16 +01:00
Shatur95
8dad1e24a2 Modernize CMake config files 2020-10-12 11:47:16 +01:00
amitdo
958f23453e Improve disabled legacy engine build 2020-10-12 11:47:16 +01:00
amitdo
06154e028b Improve disabled legacy engine build 2020-10-12 11:47:16 +01:00
amitdo
e81b485066 Improve disabled legacy engine build 2020-10-12 11:47:15 +01:00
amitdo
7df4918644 Improve disabled legacy engine build 2020-10-12 11:47:15 +01:00
Shatur95
ec8766ce74 Use DESTINATION instead of TYPE
For compatibility with older CMake.
2020-10-12 11:47:15 +01:00
zdenop
ec01b51a0f
Merge pull request #3119 from Shatur95/modernize-cmake-config
Modernize CMake Config files
2020-10-10 12:52:53 +02:00
zdenop
e5d6e90440
Merge pull request #3120 from amitdo/legacy
Improve disabled legacy engine build
2020-10-10 11:06:46 +02:00
amitdo
b378ebff2e Improve disabled legacy engine build 2020-10-10 04:49:52 +03:00
amitdo
50ca49a917 Improve disabled legacy engine build 2020-10-10 02:53:38 +03:00
amitdo
f4744de78b Improve disabled legacy engine build 2020-10-10 02:20:51 +03:00
amitdo
4b6db07462 Improve disabled legacy engine build 2020-10-10 01:33:27 +03:00
Shatur95
a0f43ca03c Generate imported target automatically 2020-10-08 01:16:01 +03:00
Shatur95
c8a164b1fb Modernize CMake config files 2020-10-08 00:51:44 +03:00
zdenop
bd6c2e5b03
Merge pull request #3116 from Shatur95/older-install-syntax
Use DESTINATION instead of TYPE
2020-10-06 08:04:57 +02:00
Shatur95
e020fbdab6 Use DESTINATION instead of TYPE
For compatibility with older CMake.
2020-10-05 20:52:20 +03:00
zdenop
755e156c14
Merge pull request #3114 from stweil/globaloc
Remove dummy functions from globaloc.cpp and related code
2020-10-05 07:31:02 +02:00
Stefan Weil
ac14ab32c6 Remove dummy functions from globaloc.cpp and related code
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-10-04 12:24:26 +02:00
zdenop
0ded9f3573
Merge pull request #3113 from stweil/pango
Remove unused functions FontUtils::GetAllRenderableCharacters
2020-10-03 18:07:42 +02:00
Stefan Weil
7c4ef88dab Remove unused functions FontUtils::GetAllRenderableCharacters
They used the function pango_coverage_max which does nothing and
which has been deprecated since pango version 1.44.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2020-10-03 12:04:40 +02:00
Egor Pugin
45413e6c42
Merge pull request #3112 from Shatur95/fix-cmake-install-configs
Fix CMake install configs
2020-10-03 00:32:05 +03:00
Shatur95
72779fb185 Fix CMake install configs 2020-10-01 22:05:02 +03:00
Egor Pugin
b19e3ee63c
Update appveyor.yml 2020-09-10 15:40:07 +03:00
Egor Pugin
76ead638e3
Update sw.yml 2020-09-10 02:05:29 +03:00
zdenop
f5561c4c42
Merge pull request #3090 from nam-leduc/correct-debug-find-images
Correct "NoImages" in debug pdf file
2020-09-07 09:22:43 +02:00
Le Duc Nam
eb8f1674bf Correct "NoImages" in debug pdf file
Issues:
  Debug information for "NoImages" just be binary image,
  it don't show up the result of photo_mask_pix to developer

Fix:
  Substract binary image to photo_mask_pix, the result
  are "NoImages" binary pix
2020-09-06 23:31:30 +07:00
Stefan Weil
162f3707e2
Merge pull request #3082 from bertsky/fix-line-detector
Fix separator line detector
2020-08-29 20:33:09 +02:00
Robert Sachunsky
640c14e080 AutoPageSeg/FindBlocks/GridRemoveUnderlinePartitions: avoid self-deletion
When checking horizontal line partitions for
possible interpretation as underline formatting,
avoid confusing the hline partition itself with
an overlapping neighbour (which would delete it).
2020-08-24 19:13:48 +02:00
Robert Sachunsky
65a077d3e9 FindAndRemoveLines/FindVerticalAlignment: decrease fixed vline min length
When detecting vertical separators, the blob aligner is used to glue
line segments (often segmented due to artificial cracks).
But (unlike LineFinder) it has many parameters that are not
relative to pixel density/resolution.
This change decreases the minimum absolute length in pixels
for vertical separators.
2020-08-24 19:13:36 +02:00
Robert Sachunsky
0228d93684 textord debugging: invert default top/bottom bounaries, improve description 2020-08-24 19:13:25 +02:00
Stefan Weil
d33edbc4b1
Merge pull request #3066 from robinwatts/pushback14
Remove unused char constant that causes a warning.
2020-07-17 15:55:51 +02:00
Robin Watts
578462109b Remove unused char constant that causes a warning.
The kDictWildcard is never actually used, so removing it makes
no difference. It causes warnings in MSVC builds as MSVC doesn't
know how to pack a unicode value into chars.
2020-07-17 14:22:37 +01:00
zdenop
749851d39d
Merge pull request #3065 from robinwatts/pushback13
Squash some warnings in MSVC build.
2020-07-16 14:41:43 +02:00
Robin Watts
150e2e54fe Squash some warnings in MSVC build.
In particular, "defined but not used" (caused by GRAPHICS_DISABLED),
double constants being truncated to floats, and implicit casts.
2020-07-16 10:08:40 +01:00
zdenop
7fa200bfb7
Merge pull request #3064 from robinwatts/pushback12
Fix Memory leak when using TESSERACT_IMAGEDATA_AS_PIX
2020-07-15 19:08:58 +02:00
Robin Watts
7f45b719d1 Fix Memory leak when using TESSERACT_IMAGEDATA_AS_PIX
If building with TESSERACT_IMAGEDATA_AS_PIX, then tesseract
doesn't compress/decompress images, but rather holds the
data as internal Pix structures. Unfortunately, I forgot to
make the ImageData destructor free these, so memory leaked
during use. Fixed here.
2020-07-15 12:35:35 +01:00