Sign in to follow this  
Followers 0
xo_Sexy

OCR SDK Maybe i dont have to re-invent the wheel?

8 posts in this topic

I have been trying to solve the overall OCR (Screen Text Capture) Problem and I have stumbled onto:

http://www.screenocr.com/

This site offers two Tools.

1) is a stand alone utility (Works Great -< Not Interested)

2) is a Command line/ Dll package offered on 21 day trial (yea, i will fork out the coin if i can make it work!)

Package found here:

http://www.ScreenOCR.com/screenocrsdk.exe

The Command line utiltity included: OCRSDKcl.exe dose and AMAZING job of recgonizing all fonts. WOW

but any (Run "OCRSDKcl.exe") in AutoIt is fairly (expectly) slow so i wish to use included DLL

OCRSDK.DLL

CODE
Is basically 1 setup function, and 3 main functions (init, read, close)

Setup Function: Specs read:

TextractExport TextractSuccess TextractBuildWithDialog();

typedef long TextractSuccess; // success returning code for Screen OCR SDK functions

I try:

$Array = DllCall("OCRSDK.DLL","long","TextractBuildWithDialog") ; VOLIA! SUCESS

CODE

Init Function:

TextractExport TextractSuccess TextractInit();

$Array2 = DllCall("OCRSDK.DLL","long","TextractInit") ; VOLIA! SUCESS

CODE

Read Function:

Textract(TextractSource(0,0,200,100),TextractDest("test.dat"),

TextractDestFormat(dfVerbose | dfBol | dfEol | dfSpace | dfChar | dfFont | dfCharHex | dfCharFont))

class TextractSource {

public:

TextractSource();

TextractSource& BmpFile(const char *bmpFileName);

TextractSource& Wnd(HWND);

TextractSource& Rect(int ax, int ay, int bx, int by);

TextractSource& DesktopWnd();

TextractSource& TopWnd(const char *windowClass, const char *windowText);

TextractSource& DeepWnd(const char *windowClass, const char *windowText);

TextractSource& SubWnd(const char *windowClass, const char *windowText);

TextractSource& SubDeepWnd(const char *windowClass, const char *windowText);

TextractSource& FindLargestWindow();

const char *BmpFileName; // used if != NULL

HWND W; // used if != NULL

int AX, AY, BX, BY; // used if BmpFileName == NULL and Wnd == NULL

};

class TextractDest {

public:

TextractDest(const char *destFileName);

TextractDest();

const char *FileName; // NULL if area specifeid, else dest file name

void *Area; // NULL if file name specified, else memory area

int AreaSize;

};

Ok I Am LOST!

OK -> I Do know i need to use DllCall,DllStructGetPtr,DLLStructCreate, DllStructSetData and DllStructGetData however

I am getting frustrated with the combinations i have (unsucessfully) Tried.

The killer part, is this software reads the text very well. I lack the pointer knowledge to plug it together.

Help?

xo_Sexy

PS:

Official Help file just gave me a headache: ScreenOCRSDK.zip

Works BEST on screen graphics. (Reads Windows database of fonts) COOL

(I am hoping other have enough interest in OCR to give this a whirl)

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I'm fairly sure that you probably found a solution by now however I thought I would mention that I had a need for OCR and have been using ScreenOCR dll with great success. If you still have questions please reply and I would be happy to assist.

Share this post


Link to post
Share on other sites

Have You made any progress on this?

Can someone please post an example on how to get this working? thanks.

Share this post


Link to post
Share on other sites

Do you have a sample code. I am desperate for a OCR Solution because the solution from ptrex is only working to 50 %. It doesnt reconniced all text.

I could kill my self ...

Please

Share this post


Link to post
Share on other sites

So far I've been doing OCR under AutoIT first with code based on IFalcon's code and then trying to get this ScreenOCR running.

While IFalcon's stuff is relatively slow, it is totally reliable and 100% precise (because I have full control over characters read). The same cannot (yet?) be said about ScreenOCR: For example the letter "X" is not recognized, capital "B", "R" and the number "3" often are dropped ...

Anyway, recently a friend got me back to testing ScreenOCR, which is amazingly fast - and the DLL supposedly lets us read directly from memory (while the EXE version needs to write to a file). My trouble: I'm totally inexperienced with COM and DLL access and the AutoIT help files assume already advanced knowledge. (Yes, I read the little intro, but - as much fantasy as I have, lol - I fail to recognize the basic underlying mechanics).

I'll start playing with published code and see how far we can get ... until then:

Does anyone have an idea of how to adjust the *.PAT (pattern) table?

Has anyone had success with direct memory access / ScreenOCR?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0