Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > fetching text from the screen

Reply
Thread Tools

fetching text from the screen

 
 
Juergen Kareta
Guest
Posts: n/a
 
      06-18-2007
Hello list,

I'm thinking about a python script which fetch some text from the screen
independent of what application provides the text on the screen. In this
regard it should be similar to the babylon software: www.babylon.com


Here my thoughts:

1) getting the mouse position
2) calculate a adequate rectangle around the mouse position
3) fetch the screen content in this rectangle
4) use a OCR library to get the text out of 3)
5) do something usefull with it.

Has someone experiences with this task ? Is this a good roadmap or
could someone think of a better way? Which OCR library shoud I use ?
Found tesseract-ocr (linux, windows) and simpleOCR (bad, only windows
(activeX).

Thanks in advance for your replays.

Jürgen
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      06-18-2007
En Mon, 18 Jun 2007 09:13:16 -0300, Juergen Kareta <(E-Mail Removed)>
escribió:

> I'm thinking about a python script which fetch some text from the screen
> independent of what application provides the text on the screen. In this
> regard it should be similar to the babylon software: www.babylon.com
>
>
> Here my thoughts:
>
> 1) getting the mouse position
> 2) calculate a adequate rectangle around the mouse position
> 3) fetch the screen content in this rectangle
> 4) use a OCR library to get the text out of 3)
> 5) do something usefull with it.


On Windows, I'd try first using WindowFromPoint to get a window handle,
and the sending it a WM_GETTEXT message. This should work for all windowed
controls that contain text of some kind. I'd use your generic approach
when this doesn't work.

--
Gabriel Genellina

 
Reply With Quote
 
 
 
 
Juergen Kareta
Guest
Posts: n/a
 
      06-21-2007
Gabriel Genellina schrieb:
> En Mon, 18 Jun 2007 09:13:16 -0300, Juergen Kareta <(E-Mail Removed)>
> escribió:
>
>> I'm thinking about a python script which fetch some text from the screen
>> independent of what application provides the text on the screen. In this
>> regard it should be similar to the babylon software: www.babylon.com
>>
>>
>> Here my thoughts:
>>
>> 1) getting the mouse position
>> 2) calculate a adequate rectangle around the mouse position
>> 3) fetch the screen content in this rectangle
>> 4) use a OCR library to get the text out of 3)
>> 5) do something usefull with it.

>
>
> On Windows, I'd try first using WindowFromPoint to get a window handle,
> and the sending it a WM_GETTEXT message. This should work for all
> windowed controls that contain text of some kind. I'd use your generic
> approach when this doesn't work.
>

Hi Gabriel,

thanks for your interesting suggestions. I'll try that to figure out,
how it works in different situations.

Jürgen
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fetching & Inserting Data into a column of TEXT Data type in SQL server 2000 Using ASP.NET Bhavesh ASP .Net 5 07-18-2007 07:39 AM
Problem while Fetching Text type of DATA in ASP.NET Bhavesh ASP .Net 1 07-17-2007 09:06 AM
Fetching & Inserting Data into a column of TEXT Data type in SQL server 2000 Using ASP.NET Bhavesh ASP .Net 1 07-17-2007 09:05 AM
Inserting & Fetching Data into a column of TEXT Data type in SQL server 2000 Using ASP.NET Bhavesh ASP .Net 0 07-16-2007 11:15 AM
problem fetching value of <input type="text"... Smugsboy HTML 6 11-30-2005 06:07 PM



Advertisments