|
Post by mrdl2010 on Nov 9, 2020 10:21:55 GMT
screen: imgur.com/E2Wnomv.pngpattern: imgur.com/mGGoJV7.pngHow can the result be like this imgur.com/0a3v0Nw.pngCan u reveal which lib you are using for the image search? utility.quickCheck(constants.ONLY_CLICKS.DIALOG_REGION_TO_CHECK, constants.IMAGES.NPC_TALK_RIGHT) function utility.quickCheck(coord, imagePath)
local region = utility.getRegion(coord)
region:highlight(2)
local match = utility.findImage(region, imagePath)
if (match == nil) then
toast('nil')
else
toast('found')
match:highlight(2)
end
end
|
|
|
Post by mrdl2010 on Nov 10, 2020 9:50:32 GMT
bump
|
|
|
Post by AnkuLua on Nov 10, 2020 11:25:25 GMT
Where did you get the utility functions? It's better that you ask the author.
|
|
|
Post by mrdl2010 on Nov 10, 2020 11:58:47 GMT
sorry I forgot that part. It is my code
function utility.findImage(region, imagePath) return region:exists(imagePath) end
function utility.getRegion(screenConstant)
return Region(screenConstant[1], screenConstant[2]
, screenConstant[3] - screenConstant[1], screenConstant[4] - screenConstant[2])
end
|
|
|
Post by AnkuLua on Nov 10, 2020 12:18:46 GMT
What's the problem? Wrong region?
|
|
|
Post by mrdl2010 on Nov 10, 2020 13:00:03 GMT
it found the pattern (the dialog icon) at the wrong place(the highlight place in the result pic)
|
|
|
Post by AnkuLua on Nov 10, 2020 14:49:47 GMT
What's the search region?
|
|
|
Post by mrdl2010 on Nov 10, 2020 15:30:07 GMT
full image 1920 x 1080
|
|
|
Post by Mercobots on Nov 11, 2020 16:37:28 GMT
hello there Just to give a quick hint , if i was you i would perform a test increasing similarity using ankulua native API! This way you can be sure the right similarity to use on that image and also check if is nothing wrong whit your utility functions
something like this
for i = 1, 3 do local s = (6 + i) * 0.1 if exists(Pattern('YOUR_IMAGE.png'):similar(s)) then getLastMatch():highlight(1) print('Similar - ' .. s) end end
Best Regards
|
|
|
Post by AnkuLua on Nov 11, 2020 23:50:43 GMT
Please just try exists("target.png"):highlight(2) -- change target.png to the searching image
|
|