get("#348") -- rgb and bright get("#137") -- split y, w, h = img.height+62-83, 21, 21 x = img.width-w if y < 0 or y+h > img.height then return "No Aibo" end aibo = [[ WWWWWWWWWWWWWWWWWWWWW WWWW????????OOWWWWWWW WWWW????????OZOWWWWWW WWWW????????OZZOWWWWW WWWW????????OZPZOWWWW WWWW????????OZRPZOOOO WWWW????????OZTRPZZZZ ????????????OZTTPZZZZ ????????????WOZTZZZZZ ????????OOOOWWOZZZZZZ ???????OZZZZOWOZ????? WWWW??OZZZZYTOXZ????? WWWW?OZZZZXTZOWZ????? WWWWPWZZZZXYZOTYZZZZX WWWWOWZZZZZZZVOVXXZXU WWWWOXZWZZZZZVVOUXZZA WWWWOXZVZZZZZOVVOTZZA WWWWOXZVZZZZZZOVSOXXX WWWWOXZRYZYYZZZOOAUUA WWWWOWZPVXSXZZZZXXAAO WWWWOYZVQURYZXXZYXXAO ]] aibo = split(aibo, "\n") while x >= 0 do total, count = 0, 0 for yy=y, y+h-1 do --s = "" line = aibo[yy-y+1] for xx=x, x+w-1 do pix = img.getInt(xx, yy) --s = s..num2hex(pix, 6).." " --s = s..(isBright(pix) and "*" or ".") c = line:sub(xx-x+1, xx-x+1) if c ~= '?' then b = math.floor(bright(rgb(pix))*25+0.5) --print("c", c) lb = string.byte(c)-string.byte("A") diff = math.abs(b-lb) --s = s..string.char(string.byte("A")+diff) total = total+diff count = count+1 --else -- s = s.."?" end end --print(s) end sim = math.floor(100*(1-total/(count*25))+0.5) --print("Aibo similarity at x="..x..": "..sim.."%") if sim >= 99 then return "Aibo: "..x..", "..y..", "..x+w..", "..y+h end x = x-1 end return "No Aibo"