Tesseract and tiff format - spp not in set {1,3}

前端 未结 4 1116
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 21:32

While trying to run this command:

tesseract bond111.tif bond111 batch.nochop makebox

I get the next error

Error in pixReadFromT         


        
4条回答
  •  走了就别回头了
    2021-02-06 22:18

    It probably means your TIFF image has an alpha channel and therefore the underlying Leptonica library used by Tesseract doesn't support it. If you're using Imagemagick then be aware that operations such as -draw can cause alpha channels to be added. If you're using convert in your workflow and want to remove the channel again immediately, flatten the image before writing by adding -background white -flatten +matte before the output filename, e.g.:

    convert input.tiff -fill white -draw 'rectangle 10,10 20,20' -background white -flatten +matte output.tiff
    

    Tesseract (well, Leptonica) accepts PNGs these days and is less picky about them, so it might be easier to migrate your workflow to PNG anyway.

    Sources: magick-users mailing list posting; tesseract-ocr mailing list posting

提交回复
热议问题