1

Tesseract can not process *.bmp files. It gives this error.

Tesseract Open Source OCR Engine v4.00.00alpha with Leptonica
Error in pixReadMemBmp: size incommensurate with image data
Error in pixReadStream: bmp: no pix returned
Error in pixRead: pix not read
Error during processing.

tesseract -v

tesseract 4.00.00alpha
 leptonica-1.74.4
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.1.0

 Found AVX2
 Found AVX
 Found SSE

stable version

tesseract 4.0.0
 leptonica-1.75.3
  libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.5.2) : libpng 1.6.34 : libtiff 4.0.9 : zlib 1.2.11 : libwebp 0.6.1 : libopenjp2 2.3.0

 Found AVX2
 Found AVX
 Found SSE


Error in pixRemoveColormap: pixs must be {1,2,4,8} bpp
Error in pixGetDepth: pix not defined
Error in pixGetDepth: pix not defined
Error in pixGetWpl: pix not defined
Error in pixGetYRes: pix not defined
Error in pixClone: pixs not defined
Please call SetImage before attempting recognition.
Error during processing.

ubuntu

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
5
  • 1
    Why are you running an alpha version instead of the stable 4.0.0 release?
    – DavidPostill
    Commented Jul 9, 2019 at 14:36
  • the result of alpha release was much better than stable release.
    – inuryyev
    Commented Jul 10, 2019 at 12:02
  • 1
    Stable version also faces error on bmp files.
    – inuryyev
    Commented Jul 11, 2019 at 15:37
  • So either you have a broken bitmap or you have found a bug (which you should report). Either way we can't help you.
    – DavidPostill
    Commented Jul 11, 2019 at 15:38
  • i think bitmap is not broken. Because i tried many files.
    – inuryyev
    Commented Jul 11, 2019 at 15:43

1 Answer 1

0

So convert the bmps to {preferably) tiff if you want to use tesseract on the results.

for a in *.bmp; do
  convert $a ${a%.*}.tiff
done

For which you need ImageMagick (convert) and bash for the code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .