awayne Posted March 30, 2014 Posted March 30, 2014 ok for my programming project checksums would work for sure however it is going to take a very long time to acquire all the checksum values i need to capture to recognize what is on the screen for a given area. I have not done much ocr work with autoit but i would not mind using tesseract since it is maintained by google and I know if google developers are maintaining the code then tesseract should be solid for ocr before i start down a wrong path i want to make sure I am taking the correct approach. for several thousand different values checksuming each value just doesnt seem optimal. I think in ocr the ocr just learns the chars so i would screencapture on an area and read in the value. if someone could provide me more insight on setting this up that would be great
JohnOne Posted March 30, 2014 Posted March 30, 2014 There's a thread dedicated to it in example scripts.All the info including examples. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
awayne Posted March 30, 2014 Author Posted March 30, 2014 john giving the 1000s of checksums i would have to do do you believe the ocr is the best approach here?
Moderators Melba23 Posted March 30, 2014 Moderators Posted March 30, 2014 awayne,Can you post a screenshot of what it is you are trying to recognise? Then we might be able to offer a better way - neither "1000s of checksums" nor OCR sound very sensible. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JohnOne Posted March 30, 2014 Posted March 30, 2014 john giving the 1000s of checksums i would have to do do you believe the ocr is the best approach here? Agree with Melba23, where you think there are thousands though, one OCR could do the lot. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Werty Posted March 30, 2014 Posted March 30, 2014 Sorry for the sidenote, but google hasnt done anything for tesseract, they "took over" development from someone else, but havent made anything to it, no credit to them that it actually works, that's the work of other guys. Some guy's script + some other guy's script = my script!
awayne Posted March 30, 2014 Author Posted March 30, 2014 (edited) Ok playing around with tesseract ocr udf and tesseractsimple udf and I had to change the path to the new tesseract path old is tesseracttesseract.exe new is Tesseract-OCRprogram will just not work if path isnt changed in tesseract udf I do however get the following error>"C:Program Files (x86)AutoIt3SciTE..autoit3.exe" /ErrorStdOut "C:UserslapDesktopocr.au3""C:UserslapDesktopSimpleTesseract.au3" (136) : ==> Variable must be of type "Object".:$Obj1.ShowFile ($capture_filename, 1)$Obj1^ ERROR>Exit code: 1 Time: 0.713my code might help, lol#include <SimpleTesseract.au3> #include <MsgBoxConstants.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,1,827,172,1072,189,1) MsgBox($MB_SYSTEMMODAL, "OCR", $OCR_Result)I want tesseract to read in an area and come back with the text value in a message boxalso just tried the older version of tesseract ocr the original version the developer of the udf was using 2.0.1Ok I am trying very hard to get this working I got the code to run and the problem was if using vista or above windows there is no image fax viewer program so you have to remove that param or set it to 0 in the code.I have tried both the older version of tesseract 2.0.1 and the latest version my message box all i get is a white block If anyone can run my current code I would be greatly appreciative if you have the Tesseract.au3 udf please try my code not sure why my msgbox is only getting white and not displaying the what would be captured text#include <Tesseract.au3> #include <MsgBoxConstants.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,1,61,469,833,508,0) MsgBox(0, "OCR", $OCR_Result) Edited March 31, 2014 by Melba23 Threads merged
Moderators Melba23 Posted March 31, 2014 Moderators Posted March 31, 2014 awayne,Please learn to use the "Edit" button - then you do not spam the forum. BrewManNH,Sorry, not sure what happened to your post when I merged all those from the OP! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
awayne Posted March 31, 2014 Author Posted March 31, 2014 sorry Melba and JohnOne I will for now on hit the edit button. I still cannot figure out why the ocr functionality is not working
Zuff Posted June 21, 2014 Posted June 21, 2014 Need some help working with this. here is my code: $firsttext = _TesseractScreenCapture(0, "", 0, 2, $planetleftindent, $planettopindent, $planetrightindent, $planetbottomindent, 1) MsgBox(0, "Tutorial", $firsttext) and here is the error message i get. "C:UsersAndyDropboxStargateTesseract.au3" (185) : ==> Variable must be of type "Object".: $Obj1.ShowFile ($capture_filename, 1) $Obj1^ ERROR Now if i click that it takes me to the udf here : $Obj1 = ObjCreate("Preview.Preview.1") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 640, 480) $Obj1.ShowFile ($capture_filename, 1) I'm guessing it is having trouble creating Preview.Preview but i am not sure. Can anyone help me with this? I am very confused why i can't get it running. Also if i chage the show image to 0, i get no errors but it also returns no text.
junkew Posted June 21, 2014 Posted June 21, 2014 (edited) most likely you did not install properly the activex controls needed $Obj1 = ObjCreate("Preview.Preview.1") has not returned an object and as such you get an error later when you try to use it as an object is shimgvw.dll installed on your system? I think its part of Windows Picture and Fax Viewer and not sure if that is installed nowadays in win7 or win8 Edited June 21, 2014 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Zuff Posted June 21, 2014 Posted June 21, 2014 What are the proper activex controls that i need? Yes i do have that dll installed on my computer.
junkew Posted June 21, 2014 Posted June 21, 2014 did you try this one? '?do=embed' frameborder='0' data-embedContent>> FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
junkew Posted June 21, 2014 Posted June 21, 2014 I would say comment this part out in tesseract.au3 as its only showing you the original input which you can easily see thru the windows explorer #CS $Obj1 = ObjCreate("Preview.Preview.1") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 640, 480) $Obj1.ShowFile ($capture_filename, 1) #ce FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Zuff Posted June 22, 2014 Posted June 22, 2014 did you try this one? '?do=embed' frameborder='0' data-embedContent>> Yes i did try this. Didn't do anything. I would say comment this part out in tesseract.au3 as its only showing you the original input which you can easily see thru the windows explorer #CS $Obj1 = ObjCreate("Preview.Preview.1") $Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 640, 480) $Obj1.ShowFile ($capture_filename, 1) #ce When i did this a box popped up like it was going to show the capture but it doesn't. I also noticed that i am getting images in my temp folder. Although it also isn't reading the text. Not sure if it's because it's red.
junkew Posted June 22, 2014 Posted June 22, 2014 What are the result(s) on a picture you want to recognize standalone? http://www.win.tue.nl/~aeb/linux/ocr/tesseract.html FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
junkew Posted June 22, 2014 Posted June 22, 2014 probably with helpfile GUICtrlCreatePic example 3 you can display the TIFF file in a proper way in that dialogbox.Tesseract makes a TIFF screenshot first.but the stuff that needs to be shown on the screen is only helping when tesseract itself is doing the job properly.But first of all get your tesseract working from the commandline of windows and after that start trying to handle it thru autoit FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
junkew Posted June 22, 2014 Posted June 22, 2014 I downloaded the tesseract and run below program without any problems W7/64 bits >Running:(3.3.12.0):C:Program Files (x86)AutoIt3autoit3.exe "testme.au3" #include <C:\Downloads\Tesseract.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,1,294,121,377,166,0) ;~ MsgBox(0, "Result: ", $OCR_Result) consolewrite($OCR_Result) and the output is not perfect but that can be tuned by learning tesseract with the right languagefiles Pusied 03 Anri2a1A—Il5 u an All, I am lwlshing a problem I am sull nanng last week and use me Tessevacl unr screencapture function to read The msmn ofTesser3ct I am using can be lmmd hem | mt s,//cnde o la cnml essemcl-ncrldnwnlnadslde om have it panaalry working on Windows 7 here us | In the UDF I had to change Ihe fulluwmg lines CHANGE: Glubal s|essem:t_1emy_pam To: sum: S(dssuvict_Iomp_pdh : “C:Tamp" AND mam folder Tenn. CHANGE: SlIellExacmuWlII('C:Pmg:m Files (x3G)Tessem:t | TO: ShollEmcneWail('C:Pvnqv2m Fvles (xasymssmc: | Iincludn <C:|1a:xlX1nwil‘h|m1oId.lIel nc:..u:> 1. 1. 294,121. 317. 166. 0) s0CR_BA5ul: = _Ieuenccsc:eenuncuze(n.' Hnglnxl?. -nuuu: ". socningsun oonao1ewn:elGOC|1_Re:u1c) >~c:Pzoqram rues (X35)AutoIcSScxTI1AutoIcS’|lravPerAuwIc3|lravDer.exe" /run /prod /lxrorscdaut /Ln '-c:usersuu:.nnocum=u:=u11xr,:::m ~>u. n:5u St-rtizg lntnltlirluasr v 2.1.n.33 >liunn1lI§ AU3CheI:k (:.a.12.u) o>1::5u:5a mam-ct an-u.xc:o >Rnnn1lW 3. .12.o):c:P:oq:an rues (x?6YAuI'.o1t3num1I'.3.exe " ,.> was ccuoncqs an Instant or Ctrlolrmk m Slap n:wuu—ne.(I.:ngu-gazuu nymuuznnnans ?5:II.l‘l_7lSe-twin: Puzl 1 cnlzxu cmxn) ix-an Pzaqxnn Fxle: lxE6)luI:nIcCl 1:erslJu1nDo::unenI'.:UIAbe:r,I2e . Au!" FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
junkew Posted June 27, 2014 Posted June 27, 2014 In this thread I added a comment to show a preview again '?do=embed' frameborder='0' data-embedContent>> FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
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