|
Post by d354n on Sept 15, 2017 5:35:35 GMT
Hi ankulua, Can we get char OCR ? Maybe The function line numberOCR, for Example: CharOCR(bigA,bigB,bigC,...,bigZ,smallA,smallB,smallC,...smallZ) Maybe it Will Scan certain char first. Most used char maybe. So it can do fast recognition. Thanks
|
|
|
Post by iamjag on Sept 22, 2017 1:58:15 GMT
I second this request.
Please. It would be helpful on detecting in change of screen or view
|
|
|
Post by AnkuLua on Sept 26, 2017 1:13:03 GMT
Will study on OCR.
To detect screen change, use following function
function screenChange(reg, second) local fileName = "__screenChange.png" reg:save(fileName) return (waitVanish(Pattern(fileName):similar(0.95), second)) end
Settings:setScriptDimension(true, 1280) wait(2) if (screenChange(Region(0, 0, 1280, 720), 5)) then print("screen change in 5 seconds") else print("sceen not change in 5 seconds") end
|
|
|
Post by iamjag on Sept 27, 2017 5:22:29 GMT
Wow. Thanks. That feature will be helpful for gathering game data. function screenChange(reg, second) local fileName = "__screenChange.png" reg:save(fileName) return (waitVanish(Pattern(fileName):similar(0.95), second)) end
Settings:setScriptDimension(true, 1280) wait(2) if (screenChange(Region(0, 0, 1280, 720), 5)) then print("screen change in 5 seconds") else print("sceen not change in 5 seconds") end
I must say, I never though of this. . However, is there a chance we can make this faster? I benchmarked waitVanish and it takes 1182ms(1.18 second) to return, that is on 0 second parameter. The game I'm making a bot need as low as 150ms to react or else its game over. My scenario is to recognize the screen and to react to it. I've also tried region:exists(pattern), this one need 3+seconds on 800 by 82 image. I guess I'm going to reduce the region. Will update you of progress. And if anyone here got an idea please let us know. I really appreciate the help. Thank You Very Much, jAGHere!
|
|
|
Post by AnkuLua on Sept 27, 2017 5:41:48 GMT
The speed is really related to machines. Normally, taking screenshot uses the most time. Media projector is fastest. Daemon is second.
It seems that the game is timing critical. Then why do you need screen changing detection?
|
|
|
Post by iamjag on Sept 28, 2017 2:50:55 GMT
There is this game that after a mission it shows a hundred box with 1 to 4 ultimate prizes. When you ready to choose, it flashes randomly placing the prizes in different location with every flash and covering it with chests. You will be able identify where it placed the ultimate prize if you capture the last flash before it covers the prize with chest. Here is my idea: In very (flash)change of screen/region capture the whole screen/region. or on last flash, capture the whole screen/region(I still need to count the flashes). However, as per your information, both method won't work due to the time it will take to detect the screen change. I'm giving up automating this part. But don't worry I have a method to get the ultimate prize. It is just not automated. Thank you for your time.
|
|
|
Post by d354n on Oct 1, 2017 6:38:39 GMT
if you can record it, maybe i can help the algorithm
how if you capture the flash prize and then: exists(flashImage) then click
|
|
|
Post by podahmad on Oct 5, 2017 11:05:48 GMT
The speed is really related to machines. Normally, taking screenshot uses the most time. Media projector is fastest. Daemon is second. It seems that the game is timing critical. Then why do you need screen changing detection? What is media projector... and is daemon faster than normal root or is it same
|
|
|
Post by AnkuLua on Oct 5, 2017 13:54:40 GMT
Media projector is an official screenshot method supported by Android since version M(or L).
daemon is faster than root.
|
|
|
Post by iamjag on Nov 17, 2017 12:37:38 GMT
Hi Admin, Any news with this request? I develop an Text OCR of my own, but it is very slow. We are still waiting for you official function. Thanks, jAGHere!
|
|
|
Post by AnkuLua on Nov 18, 2017 1:06:49 GMT
Sorry. Too many things to do.
|
|
|
Post by ed0n3 on Nov 27, 2017 9:04:25 GMT
Also working on a own OCR, but as already said, it's kinda slow and could be way more precise.
|
|
odx
New Member
Posts: 4
|
Post by odx on Dec 1, 2017 5:25:02 GMT
Hey guys, A different macro program I use (for pc) have implemented OCR quite effectively with tesseract. Whilst it makes very little sense to me, this may help you guys perusing OCR. github.com/tesseract-ocr/tesseractA typical command is in 2 parts, part 1 is screenshot area x and second part is OCR Area (abcedfeghi1234BCDEF) with the letters and numbers are used as filters with what to look for. luaforge.net/projects/luatesser/
|
|
|
Post by iamjag on Dec 18, 2017 23:56:09 GMT
I'm new to lua/sikuli. Do you have any page how to use it in ankulua?
|
|
timtim
Junior Member
Posts: 67
|
Post by timtim on Mar 14, 2018 7:42:09 GMT
I second the request for Text OCR, and should also contain option to capture decimal value eg if I want to look for a value like 1.3M of wood then it should be able to
Any idea how I can do this? Except for logically checking each character and writing a whole algorithm around it?
|
|