Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in loop GetChoiceIterator crashs python if result is empty #325

Open
NewUserHa opened this issue Oct 3, 2023 · 0 comments
Open

in loop GetChoiceIterator crashs python if result is empty #325

NewUserHa opened this issue Oct 3, 2023 · 0 comments

Comments

@NewUserHa
Copy link

api = tesserocr.PyTessBaseAPI()

api.SetImage(image)
api.Recognize()

ri = api.GetIterator()
level = tesserocr.RIL.SYMBOL
for r in tesserocr.iterate_level(ri, level):
    ci = r.GetChoiceIterator()
    for _ in ci:
        print(123) # crash before this print

api.End()

error result_it.it_->word() != nullptr:Error:Assert failed:in file C:\projects\tesserocr-windows-build\tesseract\src\ccmain\ltrresultiterator.cpp, line 383 when encountering an empty api.GetUTF8Text().

I guess the issue is probably around

def Next(self):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant