tesserocr
tesserocr copied to clipboard
Add progress tracking
It can be useful to have a callback with progress updates.
Do you have a use-case?
OCR can be relatively lengthy (especially when multiple languages are loaded), so I'd like to show some kind of progress bar.
I was hoping for a "code" example but I think I have a good idea of what you want. Will try to push something soon.
Ah. I was playing with it and found PROGRESS_FUNC2
callback:
https://github.com/tesseract-ocr/tesseract/blob/5fdaa479da2c52526dac1281871db5c4bdaff359/src/ccutil/ocrclass.h#L116-L117
I then subclassed ETEXT_DESC
to hold python callback, so I can call it from PROGRESS_FUNC2
.
It appears to be working, but only recent Tesseract 4 versions have PROGRESS_FUNC2
callback.