1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 19, 2020 20:11:56 GMT
I want to add some more chars/symbols in this function, not just 0-9
Its possible?
|
|
|
Post by AnkuLua on Mar 19, 2020 22:49:14 GMT
It's in Java. Maybe we can provide an more general function in future release.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 20, 2020 17:38:39 GMT
It's in Java. Maybe we can provide an more general function in future release. Yes pleaseeeeeeeeee
|
|
|
Post by AnkuLua on Mar 20, 2020 23:53:41 GMT
In the example that you provided in PM, you can just search the keyword images, such as Atk, Flee, Str, etc. Then use numberOCR to get the result.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 22, 2020 22:12:12 GMT
Yeah, that why I also I need to get value like "+20.2%"
|
|
|
Post by AnkuLua on Mar 22, 2020 23:06:21 GMT
Replied in PM. Repost here to help others
The secret is the region to do number OCR. You can first search race. Then use race to search "+" or "-" if there is + or - Then search "%" if any. Use the "+" or "-" and "%" region to create the number OCR region. Then it's done.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 22, 2020 23:16:13 GMT
Thanks, How about decimals?
|
|
|
Post by AnkuLua on Mar 23, 2020 0:47:45 GMT
Thanks, How about decimals? You could search decimal first. Then use number OCR for both before and after decimal.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 23, 2020 9:40:10 GMT
Thanks, How about decimals? You could search decimal first. Then use number OCR for both before and after decimal. Oh, It problem about position. Because value positions is depends on Text length. Like: STR: +10.5% Rangaged Dmg: +5.5%
|
|
|
Post by AnkuLua on Mar 23, 2020 13:30:36 GMT
You could search decimal first. Then use number OCR for both before and after decimal. Oh, It problem about position. Because value positions is depends on Text length. Like: STR: +10.5% Rangaged Dmg: +5.5% For your reference. Change the image = "str.png" to what you want. You may need to fine tune some parts. image = "str.png"
imageRegion = exists(image, 0) imageRegion:highlight(1) totalRegion = imageRegion:grow(-imageRegion:getW(), 200, 5, 5) -- modify the 200 accordingly totalRegion:highlight(1) plusRegion = totalRegion:exists("plus.png", 0) plusRegion(1) dotRegion = totalRegion:exists("dot.png", 0) dotRegion:highlight(1) percentRegion = totalRegion:exists("percent.png", 0) percentRegion:highlight(1) numberRegion = Region(plusRegion:getX() + plusRegion:getW(), plusRegion:getY(), dotRegion:getX() - (plusRegion:getX() + plusRegion:getW()), plusRegion:getH()) numberRegion:highlight(1) number = numberOCRNoFindException(numberRegion, "number")
decimalRegion = Region(dotRegion:getX() + dotRegion:getW(), percentRegion:getY(), percentRegion:getX() - (dotRegion:getX() + dotRegion:getW()), percentRegion:getH()) decimalRegion:highlight(1) decimal = numberOCRNoFindException(decimalRegion, "number")
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 23, 2020 19:08:48 GMT
Thanks, I tested. but grow() function? does it exist?
And "dot" is so hard to get it 100% success
|
|
|
Post by AnkuLua on Mar 24, 2020 0:34:53 GMT
Thanks, I tested. but grow() function? does it exist? And "dot" is so hard to get it 100% success
Yes. grow() exists. grow(left, right, top, bottom) with a separate value for each side. 0 means no change. If with problem, share your "dot" image. It's better to be as high as other numbers.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 24, 2020 9:31:12 GMT
Thanks! I will try that again.
|
|
1001z
Junior Member
Posts: 51
|
Post by 1001z on Mar 24, 2020 10:30:56 GMT
But are you planning to make OCR that supports decimals and prefix / suffix?
|
|
|
Post by AnkuLua on Mar 24, 2020 14:04:54 GMT
But are you planning to make OCR that supports decimals and prefix / suffix? What are prefix/suffix?
|
|