Jump to content
Sign in to follow this  

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

Recommended Posts

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


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:


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


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


Init Function:

TextractExport TextractSuccess TextractInit();

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


Read Function:


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

class 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 {


TextractDest(const char *destFileName);


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 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.




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

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.

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 ...


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  

  • Create New...