How can I make tesseract on iOS faster?

前端 未结 2 1048
旧巷少年郎
旧巷少年郎 2020-12-31 17:58

I am struggling with tesseract ocr on ios. Everything works fine but it is really slow. 2 - 3 seconds recogintion time for a single line of digits.

I am reading from

相关标签:
2条回答
  • 2020-12-31 18:27

    I switched to the SVN of tesseract 3.02

    After having some problems with crosscompiling,

    I am down to about 1.2 - 0.8 Seconds for getUTF8Text and 0.3 - 0.2 seconds for image preprocessing.

    I did some testing

    • Binarization and Shrinking by 0.7 gains 0.3 Seconds but costs you 0.1
    • chop_enable=0 has almost no effect on speed about a speed gain of 0.1 in average althoug it counts for 50% of the cpu usage if profiled

    The main gain in usability was to optimize the code with setRectangle not calling getUTF8Text if I suspect the bounds to be incorrect. And some String postprocessing by checking the received string and apply some algorithm to eliminate the most common misinterpretations from tesseract.

    maybe this is useful for someone else.

    0 讨论(0)
  • 2020-12-31 18:30

    One thing you might want to try is do it in the background. It will not improve the recognition speed, but by having the user do something else it might appear faster. This, of course, depends on the use case (I have one where this is a nice improvement as it seems very fast, while I just start sooner than expected). The trick is that ios apps are about perceived performance, not actual performance (although it naturally has a big impact on perceived performance).

    0 讨论(0)
提交回复
热议问题