wolfmanstout / screen-ocr

Easily perform OCR on portions of the screen, choosing from a selection of backends.
Apache License 2.0
40 stars 7 forks source link

Documentation Need #6

Open Anewri32 opened 2 years ago

Anewri32 commented 2 years ago

The winRT backend does not have enough information to be able to use it correctly, and the understanding of the catch in general is complex, there is nowhere to start to document it.

wolfmanstout commented 2 years ago

I'd like to help but I need a little more detail. You generally should not need to interact directly with the WinRT backend -- it is constructed and managed by the Reader object. For example, if you follow the WinRT installation instructions, then this code sample should invoke it behind the scenes: https://github.com/wolfmanstout/screen-ocr/blob/master/screen_ocr/__main__.py

I'm not sure what you mean by "the understanding of the catch in general is complex". What's the catch?

bernd-wechner commented 1 year ago

I landed here because of., well a Documentation Desire ;-). Specifically, this looks like it rocks, making it "it easy to perform OCR on portions of the screen.". Yet the example is for the whole screen. I'm doing some UI automation with pywinauto for example and have a UIA control, from which I can get a screen rectangle, and all I'd want up front is a clear example delivering on the promise: how to get an OCR a portion of the screen, perhaps defined by a rectangle.

This could work in awesome concert with pywinauto, for apps (like the one I'm working with) in which the UI framework renders a good many label texts graphically or at very least does not expose UIA elements that contain the text.

wolfmanstout commented 1 year ago

That's a very reasonable request @bernd-wechner! I'll improve the API so this is easier and document it.

wolfmanstout commented 1 year ago

Hi @bernd-wechner, please take a look at the updated __main__.py with simple code for doing this. Please make sure you are using the latest version, which I just released (0.4.0).