Search code examples
pythonopencvpython-tesseract

Python - what is quicker? Using opencv or pytesseract?


I'm doing some work that requires me using one of these to parse text from a screen. I've tried implementing both and I'm just completely unsure which is faster and has less strain on my pc. Does anyone have any tips?

Bonus question: another what is faster question. Should I take a single screenshot of the screen and parse the data from there after cropping to the relevant sections, or should I take multiple screenshots of the screen with those dimensions right away and then parse the data? Again, I've tried both methods and I can't tell which is better/faster.

Thanks!!!!


Solution

  • Did you try timing them to see which one is faster? For example:

    import time
    
    start_time = time.time()
    
    main() #your function using opencv/pytesseract or multi screenshot/cropped
    
    print(time.time()-start_time)