peethebee Posted September 1, 2005 Posted September 1, 2005 (edited) Hi! I coded a OCR script which is similar to one posted by someone before in order to read text in Diablo II (I think). The important thing will be that in one of the next few versions an editor will make it possible to edit the character's data either manually or AUTOMATICALLY. I would like you to test it and see the (I think impressive) screenshots. peethebee Edit: The script can be grabbed in my fileman!testimage.bmp Edited September 1, 2005 by peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Raindancer Posted September 1, 2005 Posted September 1, 2005 Wow... your script was able to read this text? Are the characters alsways the same sign? How much time does it take to read? Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
peethebee Posted September 1, 2005 Author Posted September 1, 2005 (edited) Hi! This text has been painted in MS Paint This is no special font. It compares a brunch of pixels where you can define if the pixel in relation to the starting pixel of the character HAs to be a special color or MUSN'T be of the color. Look in the .ocr file to see the data (it's just a simple ini file) Please ask your technical questions if there are more of them. It takes about 2 sec I think on a 1.500 Ghz AMD Sempron with 256 MB RAM. peethebee Edited September 1, 2005 by peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Raindancer Posted September 1, 2005 Posted September 1, 2005 Cool... Have to test it at home... And be sure... I'll ask if there are coming questions Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
peethebee Posted September 1, 2005 Author Posted September 1, 2005 I'm waiting for your results... vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
w0uter Posted September 1, 2005 Posted September 1, 2005 All my files can be found in my fileman account:http://www.autoitscript.com/fileman/users/peethebee/ My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
peethebee Posted September 2, 2005 Author Posted September 2, 2005 Thank you, w0uter! vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
peethebee Posted September 3, 2005 Author Posted September 3, 2005 Hi! 0.5 Beta inculdes a early (but working) version of the editor and a text file with tips how to speed up the scanning process. Grab it via fileman. peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 3, 2005 Posted September 3, 2005 (edited) Ah, yes I created the original D2 OCR I actually ported it over to C#, it's about 100x faster. EDIT: I can't get yours to run correctly, I open up the image in paint and run both the exe and au3 file. Edited September 3, 2005 by Insolence "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
peethebee Posted September 3, 2005 Author Posted September 3, 2005 (edited) Hi! 100 times faster... not bad *g*. You store the data similar to be, don't you? Is there an editor aailible for your project? Perhaps I could try to code one of not. Deit: It should move the mouse to the start of the character. Perhaps try to use the other .ocr file as source, cause I played around very much with them. peetehebee Edited September 3, 2005 by peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 3, 2005 Posted September 3, 2005 Hi!100 times faster... not bad *g*.You store the data similar to be, don't you?Is there an editor aailible for your project?Perhaps I could try to code one of not.peetehebee<{POST_SNAPBACK}>Editor, oh no, that'd be very hard Mine's specific and built for speed, not reusability. I store the data very differently, here's a snippit of the character definitions:class OCRDefinition { private Hashtable Definitions = new Hashtable(); public OCRDefinition () { // A-Z Definitions.Add ( "-1,0;-1,-1;-2,0;-2,-1;-8,0;-8,-1;", "A" ); Definitions.Add ( "-1,0;-1,-1;-1,-2;-1,-3;-1,-4;-1,-5;-1,-6;-1,-7;-1,-8;-2,0;-2,-1;-2,-2;-2,-3;-2,-4;-2,-5;-2,-6;-2,-7;-2,-8;-3,0;-3,-3;-3,-7;-4,0;-4,-2;-4,-3;-4,-7;-5,0;-5,-1;-5,-2;-5,-3;-5,-4;-5,-5;-5,-6;-5,-7;", "B" ); Definitions.Add ( "-1,0;-1,-1;-1,-2;-2,-1;-2,-2;-2,-3;-3,-3;-3,-4;-4,-4;-4,-5;-5,-4;-5,-5;-6,-4;-6,-5;-7,-4;", "C" ); Definitions.Add ( "-1,0;-1,-1;-1,-2;-1,-5;-1,-6;-1,-7;-1,-8;-2,0;-2,-1;-2,-2;-2,-3;-2,-4;-2,-5;-2,-6;-2,-7;-2,-8;-4,0;-4,-7;-5,0;-5,-7;-6,0;-6,-1;-6,-6;-6,-7;-7,-1;-7,-2;-7,-3;-7,-4;-7,-5;-7,-6;", "D" ); "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
peethebee Posted September 3, 2005 Author Posted September 3, 2005 (edited) Hi! ok. I will stay with my project *g*. But I think you also store a set of coordinates of the pixels, don't you? Edit: Does the scanning work now? peethebee Edited September 3, 2005 by peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 3, 2005 Posted September 3, 2005 I got it to work, sorry I went to eat a snack. I forget completely what I did to change it. I think I used a different picture (the ABC.. one) I do not set a coordinate of the pixels? The "0,1;0,2;" are the distances of the pixels from the top left most part of the character. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
peethebee Posted September 3, 2005 Author Posted September 3, 2005 I do the same thing (relative coordinates = distances). peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 3, 2005 Posted September 3, 2005 Yes but you also save the pixels, and you have a seperate definition for each pixel of a character, whereas I only have 1 definition for an entire character. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
peethebee Posted September 3, 2005 Author Posted September 3, 2005 Hi! This is a feature for chars which are not mono-colored. I just read the forum thread about plugins in C/C++. As you seem to be a skilled C# coder I would suggest that we (or you) could write a plugin to scan a part of the screen. It could be almost as fast as your solution and at the same time as open for other fonts as my way to implement it. If you do not want to help me I would like to see your C# code as I justz started to code C++. Thank you, peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 4, 2005 Posted September 4, 2005 Hi!This is a feature for chars which are not mono-colored.I just read the forum thread about plugins in C/C++.As you seem to be a skilled C# coder I would suggest that we (or you) could write a plugin to scan a part of the screen. It could be almost as fast as your solution and at the same time as open for other fonts as my way to implement it.If you do not want to help me I would like to see your C# code as I justz started to code C++.Thank you, peethebee<{POST_SNAPBACK}>You can get the entire project here: http://insolence9.com/downloads/RealOCR.zip You'll need SharpDevelop (www.icsharpcode.com I think)If I linked to the wrong archive, let me know "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
peethebee Posted September 4, 2005 Author Posted September 4, 2005 Hi! Thanks for sharing the source. I got it to run, but it showed many MsgBoxes so that I have to remove them in order to see, if the scanning works. peethebee. vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Insolence Posted September 4, 2005 Posted September 4, 2005 Hi!Thanks for sharing the source. I got it to run, but it showed many MsgBoxes so that I have to remove them in order to see, if the scanning works.peethebee.<{POST_SNAPBACK}>Yeah, I had to do a lot of debugging in that sense, sorry "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
theguy0000 Posted September 5, 2005 Posted September 5, 2005 version 0.5 beta error in editor.au3 line 27, unknown function GUICtrlCreateGraphic The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now