OCR.ahk - Library for recognizing text in images
I am having the same issue as rajk. I extracted the zip and ran OCR-preview.ahk, which made a solid pink rectangle appear briefly, and then a transparent pink rectangle with nothing in it appears at my mouse. Here is a screenshot in which you can see the transparent pink rectangle over your post, the last lines of the script executed, and my directory containing unzipped files with no PNM or JPG files at that time: http://i.imgur.com/PwcbC1N.png
I am also on Win 7 64 bit with latest AutoHotKey_L. Running as administrator and turning off UAC (not that that's a solution) doesn't affect this.
This extends support to:
AHK_L ANSI 32-bit
AHK_L ANSI 64-bit
AHK_L Unicode 32-bit
AHK_L Unicode 64-bit
Tested on AHK_L v1.1.09.04
In addition, I removed the dependency upon the CmdRet library. Not sure if anybody else will care about that, but I am happy I did it.
Nice work, camrb! Works great for the command prompt. One suggestion to make is possibly 'training' the OCR for a specific font/color/size. Since most of the time the user knows the style of text to be read, you could make it so the user can specify a sample image of glyphs (a-z, 0-9, symbols) in a specific font and color, then save these settings to give theoretically 100% accurate readings as long as the text style is known. Just a thought
woonsik: No, this OCR lib uses GOCR, which assumes English is the only language present. You may want to search the internet for OCR tools that can read Korean characters.
trend747: I don't quite follow what you are asking. If you look at the OCR-example.ahk file provided, the function takes a snapshot, and returns a string containing the text that was found in that screenshot.
Lazylimey: In the "options" parameter (the fifth one), be sure to specify "activeWindow" somewhere in there. This will allow the script to work using coordinates relative to the active window, and not the screen. PM me with an example of the issue if you can't get it figured out.
FishStik: Yes, you can make your own by taking screenshots of each character, but that is not a very sophisticated OCR, and it would require extensive configuration for each font and color. This method requires minimal configuration, and ranges between 85%-95% accuracy (that figure depends on a lot of factors). Feel free to make your own lib using your suggested method and post it on the forums to make it available to others (your suggestion would probably prove sufficient for woonsik's request posted above). Further reading: http://en.wikipedia....ter_recognition
I found your tool yesterday, and I have had VERY good luck with it. It's working very well. GOCR does a fine job, and I spent some time training it, but it was still pretty hit or miss.
I made one modification to your OCR.ahk script that helped ME a lot - may be worth adding an option.
I added "-colors 2" to the djpeg command