Skip to content

Blacklist and whitelist unsupported with LSTM (4.0) #751

Closed

Description

@nguyenq

Blacklist and whitelist no longer work in 4.00alpha. They used to work in 3.04.

https://groups.google.com/forum/#!topic/tesseract-ocr/cpcJHTE2xMo

Activity

  1. Cryspart commented on Mar 9, 2017

    @Cryspart

    Same problem for me with 4.00alpha, I tried to set tessedit_char_whitelist by using:

    • cli with option -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyz
    • cli with config file
    • tesserocr python module

    But I keep getting non letter results

    I can provide Dockerfile + python script + images if needed

  2. yshean commented on Mar 14, 2017

    @yshean

    Same problem for me. Still getting symbols and alphabets despite setting tessedit_char_whitelist="0123456789".

  3. atefm commented on Mar 28, 2017

    @atefm

    I encountered the same issue today when using --oem 1,2,3. It works fine for --oem 0 (Original Tesseract).

  4. DanielRieske commented on Apr 12, 2017

    @DanielRieske

    I am encountering the same issue, is there a solution for this issue yet?.

  5. amitdo commented on Apr 12, 2017

    @amitdo
    Collaborator

    I am encountering the same issue, is there a solution for this issue yet?.

    No.

  6. rimacv commented on Apr 13, 2017

    @rimacv

    I am facing the same issue. Is it really a bug or is it just not supported for LSTM?

  7. amitdo commented on Apr 13, 2017

    @amitdo
    Collaborator

    It's currently not supported for LSTM.

    People, please do not add another "I have the same issue" comment.

  8. Adrian-at-CrimsonAzure commented on Jun 9, 2017

    @Adrian-at-CrimsonAzure

    Are there plans to support whitelisting on LSTM in the future?

  9. zbyszek-matuszewski commented on Aug 4, 2017

    @zbyszek-matuszewski

    I also have this problem when using Tesseract 4 from C++

    tess->SetVariable("tessedit_char_whitelist", "01234567890abcdefg");
    

    has no effect on the output. The same with blacklist.

    Tesseract returns not only ascii + language-specific characters but also some strange other characters from UTF-8.

    Is there a way to get a full list of all possible characters, specific for a language or not? Basing on such list one could make a workaround to map such wrong characters to best fitting ones that are expected (like EM DASH to plain ASCII dash etc.) and remove those without any sensible fit. It would be useful for me in current circumstances and maybe it could be useful for others in need of whitelisting.

  10. Shreeshrii commented on Aug 4, 2017

    @Shreeshrii
    Collaborator

    @theraysmith Are there plans to support this for LSTM?

  11. Shreeshrii commented on Oct 3, 2017

    @Shreeshrii
    Collaborator

    In response to https://groups.google.com/forum/#!topic/tesseract-ocr/-oeCTcojYfw

    You can try the plus-minus type of training if you just want a digits type of traineddata.

    Your training_text can contain numbers in the format you need and you can train with a font matching your images.

    For proof of concept you can try my experimental version at

    https://github.com/Shreeshrii/tessdata_shreetest

  12. ErnstTmp commented on Oct 28, 2017

    @ErnstTmp

    I would like to exclude everything except letters and digits from the result. I started from eng.traineddata and trained my font from graphical images (@Shreeshrii: thanks!!)) . Is there a way to get rid of all the other symbols, especially !"=)() ... ?

    I am using --oem 1.

    Thank you very much,
    Ernst

  13. smlum commented on Mar 22, 2018

    @smlum

    has this been resolved or anyone found a workaround?

  14. amitdo commented on Mar 22, 2018

    @amitdo
    Collaborator

    has this been resolved

    No.

  15. 41 remaining items

  16. Jinnrry commented on Aug 16, 2019

    @Jinnrry

    Has anyone tested the 4.1 Version? It's supposed to be fixed now? release notes

    Really excited ! It works!

  17. stweil commented on Aug 17, 2019

    @stweil
    Member

    @nguyenq, can we close this issue?

  18. nguyenq commented on Aug 17, 2019

    @nguyenq
    ContributorAuthor

    Didn't realize I'd opened this issue. It's been so long ago. :)

  19. Shreeshrii commented on Aug 30, 2019

    @Shreeshrii
    Collaborator
  20. mhellmeier commented on Mar 20, 2020

    @mhellmeier

    Just to conclude and in addition:

    To solve the black- and whitlist problem in version 4.0, two solutions have already been mentioned:

    1. Update Tesseract to version 4.1 (the future-oriented approach)
    2. Use the legacy mode with --oem flag

    The Ubuntu package sources only contains tesseract version 4.0.0-beta.1. If you can't upgrade and don't want to use the legacy mode, try to build a simple black- or whitelist function if you are using tesseract with a wrapper in another programming language. One example with PyTesserocr can be found in this blog article: return2 – Python Tesseract 4.0 OCR: Recognize only numbers / digits and exclude all other characters.

  21. Shreeshrii commented on Mar 20, 2020

    @Shreeshrii
    Collaborator

    Alex's ppa can be used on Ubuntu for the latest versions.
    Please see https://github.com/tesseract-ocr/tesseract/wiki

  22. tammarut commented on May 10, 2020

    @tammarut
  23. amitdo commented on May 10, 2020

    @amitdo
  24. v3ss0n commented on Jun 28, 2022

    @v3ss0n

    Just to conclude and in addition:

    To solve the black- and whitlist problem in version 4.0, two solutions have already been mentioned:

    1. Update Tesseract to version 4.1 (the future-oriented approach)
    2. Use the legacy mode with --oem flag

    The Ubuntu package sources only contains tesseract version 4.0.0-beta.1. If you can't upgrade and don't want to use the legacy mode, try to build a simple black- or whitelist function if you are using tesseract with a wrapper in another programming language. One example with PyTesserocr can be found in this blog article: return2 – Python Tesseract 4.0 OCR: Recognize only numbers / digits and exclude all other characters.

    Is your method 3 a joke? It is not detection of numbers only , it is filtering out text AFTER being detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions