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

Add simple orientation detection #34

Merged
merged 4 commits into from
Jun 5, 2022
Merged

Add simple orientation detection #34

merged 4 commits into from
Jun 5, 2022

Commits on Jun 5, 2022

  1. Add simple orientation detection

    Tesseract's has built-in script and orientation detection but it is part of the
    classic (pre-LSTM) engine, which has been compiled out to reduce binary size.
    Hence this initial implementation use Leptonica's more simplistic orientation
    detection, which is based on counting numbers of ascenders and descenders, as
    described on pages 12-14 of http://www.leptonica.org/papers/skew-measurement.pdf.
    robertknight committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    c671d49 View commit details
    Browse the repository at this point in the history
  2. Display detected image orientation in OCR web demo

    In adding this I encountered issues where the same rotated image dropped into
    Safari, Chrome and Firefox could give different results. I believe this has to
    do with how the EXIF rotation information is handled by the various browser APIs
    used to load and draw images, but this still needs to be debugged.
    robertknight committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    a5380e4 View commit details
    Browse the repository at this point in the history
  3. Include confidence in orientation detection result

    The confidence value is currently 0 if an error occurred or 1 otherwise.
    This at least creates a space in the API to include a confidence score
    in the result.
    robertknight committed Jun 5, 2022
    Configuration menu
    Copy the full SHA
    ebd135c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    26893cc View commit details
    Browse the repository at this point in the history