Java project of the day - Window Reader - OCR

32 views
Skip to first unread message

Paul Klemstine

unread,
Oct 31, 2012, 4:20:55 PM10/31/12
to dhmn-di...@googlegroups.com
I just discovered the most amazing thing! 
Java finally lets you layer "invisible" windows on top of other windows. 
I can finally draw things over other windows outside of the normal Java frame.

I came up with this contraption today, "Window Reader", 
and it's still warm from the compiler.
.
The idea is you press a hotkey (CTRL-R) to activate the program.
Next you drag a box around some text on your screen.
Then that area of text gets pushed through an OCR engine, 
All the pixels in that window will try to be optically recognized into text.
The results of the text scan are popped up in a new window.

This way you can cut and paste text from images that can't normally get cut/pasted.

Windows Only! Needs the newest version of Java(7). http://java.com
Let me know how it works for you, fellow software testers.

INSTALLATION / USAGE
2. Start WindowReader.jar (double-click, or  "java -jar WindowReader.jar")
3. Press CTRL-R and then select a rectangle of text anywhere on your screen to read.
(you will see a red border around your screen, and blue words where the mouse is)
4. Wait for it! Large areas can take a few seconds to process.
5. The new popup window will show the OCR text.
6. Repeat step 3 until:
7. You press CTRL-Q to quit.

Karl P. Niemuth II

unread,
Oct 31, 2012, 4:22:54 PM10/31/12
to dhmn-di...@googlegroups.com
holy handy software bro!

Mark Nickel

unread,
Oct 31, 2012, 4:24:27 PM10/31/12
to dhmn-di...@googlegroups.com
keen... Is that a windows only feature per the java documentation or is it just that you've not tried it under Linux... ( I can't remember what your primary dev environment is...)

Paul Klemstine

unread,
Oct 31, 2012, 4:35:48 PM10/31/12
to dhmn-di...@googlegroups.com
The jar includes the OCR engine(Tesseract) as Windows x86 DLL files, but it seems to run fine on Windows 7 x64.
This could easily be recompiled to use the Linux build of the OCR engine. But I'm probably not going to do that any time soon.
License is Apache Version 2, so I don't know, could I sell this?

Mark Nickel

unread,
Oct 31, 2012, 5:01:44 PM10/31/12
to dhmn-di...@googlegroups.com
The OCR engine is Apache Version 2?


yes.  while of course I am not a lawyer, I believe that you can charge for it.

see the section on "Derivative Work"

linking to this library is not considered a derivative work, but I do not believe that the apache licenses are considered "viral" so your part does not have to be distributed as open source.


Mark

j

unread,
Oct 31, 2012, 5:35:15 PM10/31/12
to dhmn-di...@googlegroups.com

Interesting… I noticed a lot of text gets mangled by the ocr engine, particularly with punctuation such as web addresses.

 

And sometimes I’d prefer to use a mouse context menu to copy, rather than ctrl-c, but overall, pretty cool.

 

How do you create the layered window, and is it just reading the systems graphics context?

Reply all
Reply to author
Forward
0 new messages