|
Post by Phenomenal on Feb 27, 2016 1:00:20 GMT
How can I make an extremely accurate numberocr? I've using the method above and retaken the screenshots quite a few times just in case something was off. But all images 0-9 are very clear but yet when I search for them on the screen they do not come back correct.
What I'm trying to do is make a solver for when a box comes up with a random set of 4 numbers, the ocr would recognize the numbers and type them in the box below. Thanks in advance
|
|
|
Post by AnkuLua on Feb 27, 2016 1:50:21 GMT
How can I make an extremely accurate numberocr? I've using the method above and retaken the screenshots quite a few times just in case something was off. But all images 0-9 are very clear but yet when I search for them on the screen they do not come back correct. What I'm trying to do is make a solver for when a box comes up with a random set of 4 numbers, the ocr would recognize the numbers and type them in the box below. Thanks in advance How do you use function numberOCR()? Make sure the region is set up correctly. Use highlight() to make sure. If still having problem, share us the screenshot and number images, also the compareDimension.
|
|
|
Post by Phenomenal on Feb 27, 2016 16:59:08 GMT
I set my regions but now that I check them. They are a bit off. What tool did you use to set your regions/ find the coordinates to set.
|
|
|
Post by Phenomenal on Feb 27, 2016 17:04:13 GMT
How can I make an extremely accurate numberocr? I've using the method above and retaken the screenshots quite a few times just in case something was off. But all images 0-9 are very clear but yet when I search for them on the screen they do not come back correct. What I'm trying to do is make a solver for when a box comes up with a random set of 4 numbers, the ocr would recognize the numbers and type them in the box below. Thanks in advance How do you use function numberOCR()? Make sure the region is set up correctly. Use highlight() to make sure. If still having problem, share us the screenshot and number images, also the compareDimension. My code -- ========== Settings ================ Settings:setCompareDimension(true, 356) Settings:setScriptDimension(true, 356) Settings:set("MinSimilarity", 0.76) captcha = Region(128, 276, 159, 289) -- ========== main program =========== function Attack() waitClick("ATS2.5.png", 5) waitClick("Attack.png", 5) local c = numberOCR(captcha,"imagePrefix") if (exists("Captcha.png")) then click("TextBox.png") type(tostring(c)) click(Location(168, 186)) click("OkButton.png") end
|
|
|
Post by AnkuLua on Feb 28, 2016 0:25:18 GMT
I set my regions but now that I check them. They are a bit off. What tool did you use to set your regions/ find the coordinates to set. MWSnap And remember to leave some margins for regions. In most cases, we just divide the screen into four or six regions.
|
|
|
Post by Phenomenal on Feb 28, 2016 0:31:30 GMT
Could you show me how your making your regions I'm not sure how to in MWSnap. I've been using info tools for AutoIt to get the exact location via mouse. So I'd bring the target over to the top left of my object then the bottom right and use those coordinates to make a region. But it hasn't been working for once I add highlight, it highlights a larger area I didn't specify
|
|
|
Post by AnkuLua on Feb 28, 2016 0:52:41 GMT
How do you use function numberOCR()? Make sure the region is set up correctly. Use highlight() to make sure. If still having problem, share us the screenshot and number images, also the compareDimension. My code -- ========== Settings ================ Settings:setCompareDimension(true, 356) Settings:setScriptDimension(true, 356) Settings:set("MinSimilarity", 0.76) captcha = Region(128, 276, 159, 289) -- ========== main program =========== function Attack() waitClick("ATS2.5.png", 5) waitClick("Attack.png", 5) local c = numberOCR(captcha,"imagePrefix") if (exists("Captcha.png")) then click("TextBox.png") type(tostring(c)) click(Location(168, 186)) click("OkButton.png") end Would you mind sharing the number images and screenshot. It's better to provide region image. And avoid using direct coordinates in region for number OCR. Here is one example from line Rangers local feather = find("feather.png")
local backslash = find("featherBackslash.png") local numRegion = Region(feather:getX() + feather:getW(), feather:getY(), backslash:getX() - (feather:getX() + feather:getW()), feather:getH()) numRegion:highlight(1) return(numberOCR(numRegion, "feather"))
feather.png featherBackslash.png and the result of numRegion:highlight(1) In our experience, compareDimension should be at least 640 for good OCR result. 1280 is better. That's why we use blue stacks 1 to develop the script.
|
|
|
Post by Phenomenal on Feb 28, 2016 1:31:18 GMT
|
|
|
Post by AnkuLua on Feb 28, 2016 2:09:18 GMT
The third and fourth parameters of region are width and height, not coordinates.
|
|
|
Post by Phenomenal on Feb 28, 2016 19:41:05 GMT
The third and fourth parameters of region are width and height, not coordinates. I just fixed that issue and the region is now perfect but it's still not picking up all 4 numbers
|
|
|
Post by AnkuLua on Feb 29, 2016 0:40:08 GMT
Would you mind sharing the number images? And the compareDimension may be too small. Recapture the number images under 600 width. Resize the mobizen windows to maximum. it should be 600 then.
If you don't want to recapture all image. You can set the compareDimension to 600 before numberOCR. Chage compareDimension back after numberOCR.
|
|
|
Post by Phenomenal on Feb 29, 2016 1:54:03 GMT
The third and fourth parameters of region are width and height, not coordinates. I fixed the issue with the numbers by putting the similarity on .73 But now when I share it to any different device my regions are off by a lot. How can I fix this
|
|
|
Post by AnkuLua on Feb 29, 2016 2:09:11 GMT
When creating region for numberOCR, don't use absolute coordinates. It's very possible to have offset in other devices. Use an anchor to get the starting coordinate. ankulua.boards.net/post/560/threadIn your case, the left corner of "OK" button is a good choice.
|
|