GithubHelp home page GithubHelp logo

Empty image detection about pyocr HOT 7 CLOSED

openpaperwork avatar openpaperwork commented on May 16, 2024
Empty image detection

from pyocr.

Comments (7)

jflesch avatar jflesch commented on May 16, 2024

Please keep in mind that Pyocr is just a wrapper for Tesseract and Cuneiform. Therefore, does Tesseract or Cuneiform provide such functionality ?

from pyocr.

lubo avatar lubo commented on May 16, 2024

That's why I stated If it's possible. I don't know if they provide API for that, but Tesseract prints to stdout Emtpy page!!! when it detects one. I thought you could provide more info on that one.

from pyocr.

jflesch avatar jflesch commented on May 16, 2024

I can't find any option related to what you are looking for. I doubt there is one. I think being able to tell there is no text implies that you must try to find text, which in turn implies running the full OCR process to be perfectly sure.

I'm going to close this ticket. Feel free to comment here if you find such option, and I will reopen this ticket.

from pyocr.

jflesch avatar jflesch commented on May 16, 2024

BTW, are you looking to know if there is no text at all (only images, photos, etc), or if the input image is actually empty ?
Both things are not the same at all. If you want to know whether there is text or not, using Tesseract makes senses. However, if you want to know if an image is entirely empty, you should look at image processing libraries (OpenCV, libpillowfight, etc).

from pyocr.

lubo avatar lubo commented on May 16, 2024

I want to know if there is a text or not. If I wanted to know, whether an image is entirely empty, I would go for Google Cloud Vision for sure. Also, Google Cloud Vision can do something close to what I want, and it's that you can limit number of detected text annotations. But it still returns way more data than I need and it's kind of expensive for just saying whether there is a text or not.

from pyocr.

lubo avatar lubo commented on May 16, 2024

I've been playing around with Tesseract CLI and just found out it returns Script and Script confidence in OSD-only PSM. Using this feature seems to be ~36x faster than using mode 3 on a image with ~12,000 characters (2.4 instead of 88.3 seconds). I see that these values are omitted in detect_os(handle).

from pyocr.

jflesch avatar jflesch commented on May 16, 2024

Oh good point, I forgot about this, my bad :
https://github.com/openpaperwork/pyocr/#orientation-detection << "detect_orientation() MAY raise an exception if there is no text detected in the image." << this part actually concern Tesseract. Tesseract (3.03) does return an error when there is no text.

from pyocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.