1

I haven't found a solution yet. What I am trying to do is read specific numerical text values from a proprietary financial software platform. I have first tried accessibility and element spy methods, unsuccessfully. The only other method I can think of that would work is to use OCR of the screen, with specific fixed regions.

All the OCR solutions I have checked out seem to be file based (PDF, TIFF, etc). What I really need is an OCR solution that can capture from the screen. A few challenges I can think of: The text to be captured is on a black background and could be colored text (yellow, green, red, orange). The text size is also pretty small (6pt's I think).

Ideally I would like a .NET API, but what ever works I am willing to try.

omencat
  • 1,155
  • 1
  • 11
  • 18
  • Can you say what the program is and what you are trying to accomplish, there may be other ways to accomplish what you want to do. Don't fall in to the [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). – Scott Chamberlain Oct 01 '12 at 15:49
  • Sure, the program is called thinkorswim. I believe it is a Java application. One solution I tried was Screen Scraper Studio. They claim to be able to extract UI elements from Java applications, but I was unable to do so with their program. Screen Scraper Studio also has OCR method on a screen region, but I found that the OCR worked as expected less than 50% of the time, and I need it to work closer to 99%. – omencat Oct 01 '12 at 16:36

2 Answers2

2

This may not answer your OCR question, but one last method you can try is hook windows' DrawText API. I recently learned about this to solve a similar problem like you had myself.

Go download the EasyHook library and look at the examples. Try hooking DrawTextA, DrawTextW, DrawTextExA and DrawTextExW on the external app (It will be different code than I had in my question because I was hooking a Inproc DLL, not a external program, but your use case is what EasyHook was designed to do, my way was a hack). Find out what it uses and see if you can get your code to parse the text out.

Community
  • 1
  • 1
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
1

Try this OCR SDK

You make a screenshot, specify region and pass it to OCR. We got good results with such approach. We also tried tesseract but were unable to make it work properly with screen fonts.

Mike
  • 1,717
  • 2
  • 15
  • 19