Jump to content

blackmage999

Members
  • Posts

    18
  • Joined

  • Last visited

blackmage999's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. You might look at the UDF, post #64.
  2. sounds like you might need on OCR if the text your looking at is in a image file like .jpg, .bmp, .png, ect... it all depends on what your trying to extract the text out of. an example would help
  3. you might take a look at this thread
  4. you are using the last parameter wrong. its supposed to be a number from 0 - 255 and used when the color of the image your looking for would vary in shades. using the images on this browser, i used this code and got the correct results #include <ImageSearch.au3> $x1=0 $y1=0 WinActivate("Image Search Library - AutoIt Forums - Google Chrome", "") WinWaitActive("Image Search Library - AutoIt Forums - Google Chrome", "") $result = _ImageSearch(@DesktopDir & "\sq.bmp",1,$x1,$y1,0) if $result=1 Then MsgBox(0, "", "found") Else MsgBox(0, "", "not found") Exit EndIf And one more suggestion. I find that using BMP's get correct results more often...could just be me though :-p
  5. There is an image search UDF in the example scripts forum. the download is a couple pages in (the link in the first post is broken i believe) Edit: download link is in post #64
  6. I just have a .au3 I named "blank" for test snippets and code I'm not worried about saving
  7. I assume you're talking about the "$ocrlearn". While testing the UDF, I put $ocrlearn = "" as a quick work around. It dosn't look like its used for anything at the moment. I think its either something hes planing or something he took out. Looks like $glue1 = "" through $glue6 = "" don't get called either. This is what I was using for testing purposes #include <OCR.au3> $ocrlearn = "" ; A B C D E F G H I J K L M N O P Q R S T U V W X Y Z $data = _OCR(209,263,593,278,0,15791353,@DesktopDir & "\font.txt",$ocrlearn) ; the cords make a box around the letters MsgBox(0, "", $data) I think the number of lines required before it sees a space should be dependent on the height of the search area. I'll try to work on this some time this week, maybe try to reverse engineer it and post my results. I might think of something new or I could just fail horribly :-p
  8. It took me a second to read through it all and understand it, but I got there (and that's saying a lot because half the time I cant even read my own script :-p). I was playing around with it using it on the SciTE editor and results were fairly good. The only problems I had were the first entry being skipped (which I fixed by putting @@@@ on the first line) and if there were too many glued letters, it started returning the code for the letters (I tried doing "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" and it returned a real mess). I'm also trying to figure out how to make it see spaces...
  9. Are you actualy asking for help or asking us to code something for you? If you need help, lets see what you got so far and we can go from there.
  10. why not use If StringInStr($database,$string[$a]) Then ;check if value already exists in database $pos = StringInStr($database,$string[$a]) $data = $data&StringMid($database,($pos-4),1) Else instead of If StringInStr($database,"@ "&$string[$a]&" @") Then ;check if value already exists in database $pos = StringInStr($database,$string[$a]&" @") $pos2 = StringInStr($database,"@",0,1,$pos-10) $data = $data&StringMid($database,$pos2,($pos-$pos2)) Else I had the trouble of the first entry in the font file not being recognized, and doing that fixed it. To be honest, I didn't completely understand what you had written for that spot in the first place (the -10 threw me off). I'm still fairly new, and this project will be a great learning experience for me. I love the idea, and the simplicity of it boggles my mind. For a language trying to emulate human input, an OCR seems like a logical step to achieving that goal. Edit: the reason the "glued" letters aren't appearing separately is because the last element of the first letter is getting added to the first element of the second letter TA @ 524|516|964|572|516|4|524|768|708|180|140|1020|512 @ T @ _524|516|964|572|516|4|12 @ A @ ___________________512|768|708|180|140|1020|512 @ So I guess that's why you had the original check in there, because my fix only returns the A...so now to figure out why the first entry in the font file is getting skipped :-(
  11. you mean page 4 (posts 63 and 64)
  12. I downloaded seangriffin's tesseract installer but when I run tesseract through the command line, i get an error log that reads: Unable to load unicharset file C:\Program Files\Tesseract\;C:\Program Files\Tesseract-OCR\tessdata/eng.unicharset I double checked and i do have the eng.unicharset. The thing thats throwing me off is the "Tesseract-OCR"...that directory wasn't in the install package. Is there something missing from it or am i just missing something?
  13. I too am looking to do this. I was using freeOCR that used tesseract, but it was too slow (i had to WinActivate, click on the open button, type in the file, click ocr, remove the line breaks, put it to clipboard, then clear the output screen). It took about 6 seconds to ocr each file. Not to metion the fact that it just stoped working (still have no idea why). Being able to get the ocr results without having to go through all that extra stuff would decrease the time my program took to identify each line dramatically. Going through the tesseract udf i found this line of code... ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename) http://www.autoitscript.com/autoit3/docs/functions/ShellExecuteWait.htm Im assuming thats what it uses to call the ORC...I have no experience using ShellExecuteWait, nor do know how to use it. the help file is very confusing to me and i would wonder if someone could explain it to me better. tried using this... #include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\test images 2\WhatScreen.tif", 17, 111, 175, 125) Sleep(1000) ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", @DesktopDir & "\test images 2\WhatScreen.tif" & " " & @DesktopDir & "\test images 2\WhatScreen.txt") but no .txt file
  14. Is there a way to call the OCR for an image already created (point it to the path)? Going through this udf i found this line of code... ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", $capture_filename & " " & $ocr_filename) Tried using this... #include <ScreenCapture.au3> _ScreenCapture_Capture(@DesktopDir & "\test images 2\WhatScreen.tif", 17, 111, 175, 125) Sleep(1000) ShellExecuteWait(@ProgramFilesDir & "\tesseract\tesseract.exe", @DesktopDir & "\test images 2\WhatScreen.tif" & " " & @DesktopDir & "\test images 2\WhatScreen.txt") but no .txt file swimming through that sea of code got me confused and i cant tell what i would replace the variables with. The help file for ShellExecuteWait is very confusing to me and i was wondering if anyone could explain it to me better.
  15. First of all, sorry about my last post about game automation. I've downloaded other scripts for MTGO on here so I didn't even think to look to see if it was ok. All my post was really about was how to get tesseract installed and incorporated into AutoIt, and to see if I was on the right track to learning how to script with AutoIt. So far I only have scripts for games, so Im not sure how I can post a full script to be checked. I guess to get around that, could someone give me a project to do that I can post on here so I can see where if im on the right track to learning the language? and also any help with using tesseract would be greatly appricated.
×
×
  • Create New...