|
Post by AutoBOT on Jun 17, 2017 16:20:51 GMT
first while I understand that setCompareDimension is for comparing the image from the current pic I have with the actual screenshot taken by the game when running it. I have my pic database rescaled to 640 from 2560 and I set the setCompareDimension to 640. the question is.
1. almost all phone can recognize the pic when I run it right?
================= now move to the harder part. then if my script is written in 2560 width along with all the SEARCH REGION, and someone use it with way lower resolution let's say 640 or 1280.
2. if I set the setScriptDimension 2560, my friend's phone will change to 2560 and it will have same region as mine right?
I don't understand at this part. let's say my region(1280, 50, 100, 100) it's in the middle of my screen (my phone is 2560). so what will my friend's 640 phone will do to search that region feels impossible.
then now the other way, I set my setScriptDimension to 1280. my lowerRightRegion(640, 360, 640, 360). then my friend with 2560 use my script, my lowerRightRegion is definitely not in the lower right, right?
can someone explain what does the setScriptDimension do in my both scenario.
|
|
|
Post by AnkuLua on Jun 18, 2017 1:19:31 GMT
>> 1. almost all phone can recognize the pic when I run it right? The answer is yes if the aspect ration is almost the same.
2.1 Script dimension is 2560. And your friend's phone is 640. Then all the screenshot will be scaled to 2560 and do the region search. On the scaled 2560 image, region(1280, 50, 100, 100) exists and is in the middle. 2.2 Script dimension is 1280. And your friend's phone is 2560. Then all the screenshot will be scaled to 1280 and do the region search. On the scaled 1280 image, region(640, 360, 640, 360) exists and is in the lower right.
=========== EDIT: Here assume that the compareDimension is 640 2.1 script dimension = 2560 and region(1280, 50, 100, 100) region will be change to 1/4 (640/2560), that is (320, 12, 25, 25). Then do the region (320, 12, 25, 25) search on the 640 scaled screenshot.
2.2 script dimension = 1280 and region(640, 360, 640, 360) region will be changed 1/2 (640/1280), that is (320, 180, 320, 180). The do the region (320, 180, 320, 180) search on the 640 scaled screenshot.
|
|
|
Post by AutoBOT on Jun 18, 2017 3:38:27 GMT
>> 1. almost all phone can recognize the pic when I run it right? The answer is yes if the aspect ration is almost the same. 2.1 Script dimension is 2560. And your friend's phone is 640. Then all the screenshot will be scaled to 2560 and do the region search. On the scaled 2560 image, region(1280, 50, 100, 100) exists and is in the middle. 2.2 Script dimension is 1280. And your friend's phone is 2560. Then all the screenshot will be scaled to 1280 and do the region search. On the scaled 1280 image, region(640, 360, 640, 360) exists and is in the lower right. wait what, all the screenshot will be rescaled to 2560. so how's the flowchart work if I have my setCompareDimension to 640, setScriptDimension to 2560 and I want to find my click my pic in that region on scenario 1 before. and my friend's phone is 1280? actually the one I want to ask is, I don't need to make a lot of different region if the aspect ratio is the same right.
|
|
|
Post by AnkuLua on Jun 18, 2017 4:13:01 GMT
Sorry. On previous reply, had a confusion on script and compare dimensions. Please see the edited reply.
And if aspect ration is the same, you can use one script for all devices. It includes the regions. Center region is always center on all devices. And lower right region is always lower right. etc..
|
|
|
Post by AutoBOT on Jun 18, 2017 4:37:25 GMT
Sorry. On previous reply, had a confusion on script and compare dimensions. Please see the edited reply. And if aspect ration is the same, you can use one script for all devices. It includes the regions. Center region is always center on all devices. And lower right region is always lower right. etc.. okay I understand now. last question to confirm it. i make a script my phone 16:9 2560x1440, friend's 16:9 640x360 setCompareDimension 640 setScriptDimension 2560 everything that I make, including region should be fine on his phone right. and it will be working fine in all 16:9 ratio. but not with 16:10 (maybe working but there will be a bug here and there). 1. so in order to fix that what should I do? 2. I crop all image based on 16:10 and make new region based on 16:10 too? 3. same goes with 4:3 and other aspect ratio? I want to make it works for all aspect ratio, what is the best and easy way
|
|
|
Post by AnkuLua on Jun 18, 2017 5:47:47 GMT
For different aspect ratios, it depends on the game. For 16:9 and 16:10, you may try autoResize to get the correct compare dimension. ankulua.boards.net/thread/169/common-library-autoresizeAlways try to make the region larger to cover both. But for 4:3, it doesn't work normally. The best way is to write it separately.
|
|
|
Post by AutoBOT on Jun 18, 2017 5:54:17 GMT
got it. thank you now I understand completely. hope it will help for others too.
|
|