title: How to speed up simple OCR task?
body: <p>I got script that plays a simple math game: given a math equation (eg: 1 + 1 = 3), tap the True or False button in a progressively shorter limited amount of time.</p>
  
  <p>I use:</p>
  
  <ul>
  <li>PIL for screen capturing and preprocessing (inverting)</li>
  <li>(Py)Tesseract for OCR</li>
  </ul>
  
  <p>Pseudocode:</p>
  
  <pre><code>while True:
    capture_and_invert_image_with_PIL() # ~0.065+ sec
    read_image_with_pytesseract()       # ~0.100+ sec
    check_math_expression()             # ~0      sec
    click_button()                      # ~0.035+ sec
    wait_for_next_equation()
                                  # total ~0.200+ sec
  </code></pre>
  
  <p>I have trained a custom font language to decrease the OCR process to 0.1 sec from ~0.45 sec with the default <code>eng.traineddata</code> and ~0.25 sec with the fast version.</p>
  
  <p>Solutions I think could work but haven't found any way to do them:</p>
  
  <ul>
  <li>Run Python at 100% CPU (most Google results say multithreading which is impossible for this task)</li>
  <li>Run Tesseract at 100% CPU </li>
  <li>Keep Tesseract running (so no loading to memory everytime, I guess)</li>
  </ul>