
awayne
Active Members-
Posts
29 -
Joined
-
Last visited
Everything posted by awayne
-
>>>> Window <<<< Title: My Custom app Class: WindowsForms10.Window.8.app.0.141b42a_r15_ad1 Position: 0, 0 Size: 1440, 860 Style: 0x170B0000 ExStyle: 0x00050000 Handle: 0x00A101B0 >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 287, 717 Cursor ID: 0 Color: 0x000000 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<<
-
jdelaney The text I would want would be a specific area of the screen.
-
jdelaney I am just trying to read text on the screen learning in general no particular project in mind I like the simplicity of autoit and have a perl python background I like how easy it is to do GUI windows automation with autoit. The community and the very good documentation. The help file is about the best I have seen so this is fun to learn something new. Is there anything you can do with caching etc?
-
What is the absolute fastest way to OCR with autoit? Do someone have a coded solution for this. I tried the Tesseract UDF, but it was entirely too slow using screen captures and grabbing values. Also highly inaccurate as well.
-
My apology I had just solved a puzzling problem for the community and wanted to share; so, if anyone uses Tesseract.au3 udf on windows 7 they can use the corrected version above and it should work out of box. Thanks for all your contributions though to the community and to autoit Melba23. You are very active on this forum so your dedication is appreciated in helping us new people learn.
-
Ok I am posting my solution for 3.0 and windows 7 and the updated UDF again Tesseract.au3 the attached edited is working in windows 7 this should save someone a huge headache so I am hoping people find this thread. #include <Tesseract.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,3,295, 73, 373, 112,0) $file = "outfile.txt" FileOpen($file, 1) FileWrite($file, $OCR_Result) FileClose($file) I typed the text word "text" in a notepad document and was able to grab the coordinates in the form of a rectangle and print the word text to an output file. To see the edits to the original udf please see the post above toward the end. Again the edits to the below also I forgot to mention to get tesseract v3 working with Windows 7 I also had to change three path settings to tesseract in the file. Tesseract.au3
-
All, I am revisiting a problem I am still having last week and if anyone has Tesseract OCR installed on windows 7 and the Tesseract.au3 UDF and can test for me I would be greatly appreciative this has been bugging me for about a week now. My goal is to use the Tesseract UDF screencapture function to read in text. #include <Tesseract.au3> $OCR_Result = _TesseractScreenCapture(0,"",1,1,294,121,377,166,0) MsgBox(0, "Result: ", $OCR_Result) The version of Tesseract I am using can be found here if anyone wants to install and test with the attached UDF. https://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-setup-3.02.02.exe OK I have it partially working on Windows 7 here is what I had to do. In the UDF I had to change the following lines. CHANGE: Global $tesseract_temp_path = "C:" TO: Global $tesseract_temp_path = "C:Temp" AND created folder Temp CHANGE: ShellExecuteWait("C:Program Files (x86)Tesseract-OCRtesseract.exe", $capture_filename & " " & $ocr_filename) TO: ShellExecuteWait("C:Program Files (x86)Tesseract-OCRtesseract.exe", $capture_filename & " " & $ocr_filename, "", "", @SW_HIDE) The new downside is I will have extra characters etc which I can just regex out if they are about the same everytime so I will consider my problem solved. Tesseract.au3
-
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
-
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-OCR program 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.713 my 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 box also just tried the older version of tesseract ocr the original version the developer of the udf was using 2.0.1 Ok 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)
-
john giving the 1000s of checksums i would have to do do you believe the ocr is the best approach here?
-
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
-
finding pixelchecksum value on screen
awayne replied to awayne's topic in AutoIt General Help and Support
#include <MsgBoxConstants.au3> $var1 = 20 $var2 = 128 $var3 = 290 $var4 = 142 $findchecksum = PixelChecksum($var1, $var2, $var3, $var4) $count = 0 Do $count += 1 ;$var1 += 1 $var2 += 1 ;$var3 += 1 $var4 += 1 $findchecksum = PixelChecksum($var1, $var2, $var3, $var4) Until $findchecksum = 3666222030 or $count > 1000 if $findchecksum = 3666222030 Then MsgBox($MB_SYSTEMMODAL, "Find Checksum", "Checksum Coordinates Found! " & $var1 & "," & $var2 & "," & $var3 & "," & $var4) Else MsgBox($MB_SYSTEMMODAL, "Find Checksum", "Checksum Coordinates NOT FOUND!!") EndIf above is working code seems to work if something is in a row/list and if you move the value around this will find it one would have to go up or down so that would be depending on adding or subtracting -
finding pixelchecksum value on screen
awayne replied to awayne's topic in AutoIt General Help and Support
oh my original value the reason for starting with 1 and 15 is the second and fourth coordinate values are 14 in difference so i have to increment by 1 for each as such thanks to all who reply also not sure if i did the message box for the first condition on if right bc i have yet to meet that condition -
finding pixelchecksum value on screen
awayne replied to awayne's topic in AutoIt General Help and Support
this is on the same monitor im working off a laptop here is some code i threw together real fast #include <MsgBoxConstants.au3> ;make a small rectangle over an area grow it in order to find a pixelchecksum value $var1 = 20 $var2 = 1 $var3 = 290 $var4 = 15 $findchecksum = PixelChecksum($var1, $var2, $var3, $var4) $count = 0 Do $count += 1 $var2 += 1 $var4 += 1 $findchecksum = PixelChecksum($var1, $var2, $var3, $var4) Until $findchecksum = 3213030855 or $count > 1000 if $findchecksum = 3213030855 Then MsgBox($MB_SYSTEMMODAL, "Find Checksum", "Checksum Coordinates Found!", $var1, $var2, $var3, $var4) Else MsgBox($MB_SYSTEMMODAL, "Find Checksum", "Checksum Coordinates NOT FOUND!!") EndIf I also know that my value has to match in area from my other value i am using the following http://www.mathopenref.com/coordrectareaperim.html -
I have screen A that has the same black background with text and then i have screen b same text same background but in a different location everything is the exact same i just need to find the checksum value i recorded on screen A in screen B. any thoughts would be helpful this is on the same computer btw.
-
Determining lenth and height off screen coordinates
awayne replied to awayne's topic in AutoIt General Help and Support
A LOT OF Googling answered my question. I will have to play around with this to get the length and width values from coordinate values it appears they are subtracting. Also can do perimeter. Good ol geometry. http://www.mathopenref.com/coordrectareaperim.html I will likely script something to make sure my coordinate grabs are equal in area. A side question how can I make sure that smoothing is turned off since that can create conflicting checksum values?? I will be honest I am not even certain I know what smoothing is. -
I am using PixelCheckSum and I am wanting to make sure the coordinates I am using are covering say the same area using a rectangle. Is there math etc to make sure I am covering the same area. My ultimate goal is to have a stored checksum as a scalar variable and look in an area on the screen and determine if the checksum value exist in that area. When I am creating the initial variables I need to make sure my look at area is going to be the same size rectangle as my initial value. Thanks to all who reply
-
JohnOne I have thought about OCR however if I can get done and there is a way to tell if four coordinates are going to be cover the same amount of area if my black background and then text is in another area of the screen and i say. if $checksumvalue is located at some four coordinates then do something. Is there a way to tell if the four PixelCheckSum values have the same area size as the original grab for the variable??
-
I guess for the purpose of what I am wanting to do is create a crosshair that is a rectangle and be able to move the rectangle around and a way to capture the rectangle top left and bottom right and turn this into the PixelCheckSum Coordinates just wondering what would be the best avenue to program such a tool or if one already exist
-
ok my next question then is there a tool that will give precision coordinates or I could try to code one. what i have is a bunch of text on a black background and would like to use pixelchecksum and capture the values and if i see this text again capture the value again but the text on black background will be in a different location on the screen
-
so if I am trying to scan an image at x and y and i move it to x and y as long as I am checksuming "EXACTLY" the same image again and only that image the checksum values should be the same?? I know I would have to change the coordinates to capture the image checksum again.
-
johnone thanks for the reply this is the same exact background and image though just in a different location now and my capture size is the same so I am only getting the image that is just a black background and text. I just want to clarify so the checksum value will also change if it is in a different location on the screen even if it is the same exact thing being capture?
-
I am working with pixel checksums and when I have a rectangle over the same image text with same sized rectangle I am getting different checksum values when I move the text image to different areas of my screen?? Is this normal. Maybe I need to be doing something else or like the example indicates are PixelCheckSum best used to detect something has changed on the screen rather than whats on the screen.
-
Ok thanks for your reply I will do some more troubleshooting