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

fix failure to OCR: general quality issue due to LSTM being fed noisy/crappy *original* image pixels instead of cleaned-up binarized pixels. #4111

Closed
wants to merge 1 commit into from

Commits on Aug 5, 2023

  1. - fix Bushnell OCR bug (failure to properly OCR the number "11"; see …

    …message chain in mailing list: https://groups.google.com/g/tesseract-ocr/c/5jrGvsrdqig/m/jvTG6L9zBgAJ): it turns out tesseract erroneously grabs the ORIGINAL image (instead of the THRESHOLDED/BINARIZED one!) to extract the word box (Tesseract::GetRectImage()) which will be fed into the LSTM OCR neural net in order to OCR the detected text area.
    
      Ergo: this fix SHOULD improve OCR results generally, as this is a generic bug which impacts ALL text bboxes found in a given input page image, which are then being pumped into the LSTM engine to obtain OCR'ed text.
    
      This fix was verified to work in an otherwise patched/augmented tesseract rig: GerHobbelt/tesseract: commit series bb37cf3, ffc1997, 15d2952, 69416e5, f49826b, d53c1a2, 44f2f84, where I worked on removing the curious BestPix() API, which SEEMINGLY was originally meant for ScrollView-et-al debug display purposes, but is (IMO) an ill-named API for that purpose.
    
    - remove accompanying, now obsolete, comment
    
    - also remove the need for BestPix() API usage in EquationDetect::PrintSpecialBlobsDensity() by invoking the API that delivers what's actually used there: the image height. Here BestPix() usage is also wrong (theoretically) as the sought-after image height is about the actual height of the binarized image data, which represent the cleaned-up-and-ready-for-use OCR sourcing image data.
    GerHobbelt committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    30268c0 View commit details
    Browse the repository at this point in the history