timtim
Junior Member
Posts: 67
|
Post by timtim on Dec 26, 2017 19:43:59 GMT
I am trying to get the best pic out of a list of pics. Using this page as reference :- sikulix-2014.readthedocs.io/en/latest/region.html#Region.existsBut am getting:- Runtime error: attempt to call global 'findBestList' (a nil value). From what I understand is that, the code is unable to find - findBestList(<list>) method. Do I need to add any library from sikulix to make it work??? Here is the code -- ========== Settings ================ Settings:setCompareDimension(true, 1065) Settings:setScriptDimension(true, 1065) Settings:set("MinSimilarity", 0.85) -- ========== main program =========== allLevels = {"EmptyPlot.png","ResLvl01.png","ResLvl02.png","ResLvl03.png","ResLvl04.png","ResLvl05.png","ResLvl06.png","ResLvl07.png","ResLvl08.png","ResLvl09.png"} function findCurrentLevel() indexFoundAt = 0 match = findBestList(allLevels) if match then print ("found img" .. match.getIndex()) indexFoundAt = match.getIndex() end return indexFoundAt end print("findCurrentLevel(10) = " .. findCurrentLevel(10))
|
|
|
Post by Exilereven on Dec 26, 2017 20:13:29 GMT
Try:
getScore()
Use FindAllNoFindException()
Then run get score on all pictures, or just make a table of .png, then use get score to find highest score.
I'm at work but I can give a working example in a couple hours when I get home.
But I'm thinking what your looking for is getScore()
It will tell you exact "matching score" each png will have.
|
|
|
Post by Mercobots on Dec 26, 2017 23:28:59 GMT
|
|
timtim
Junior Member
Posts: 67
|
Post by timtim on Jan 9, 2018 5:34:38 GMT
Thanks will try and report.
|
|