# 人工智能AI挑战微信跳一跳，解析玩法秘籍

AI算法不仅远远超越了人类的水平，在速度和准确度上也远远超越了目前已知的所有算法，可以说是跳一跳界的state-of-the-art，下面我们详细介绍我们的算法。

def multi_scale_search(pivot, screen, range=0.3, num=10):

H, W = screen.shape[:2]

h, w = pivot.shape[:2]

found = None

for scale in np.linspace(1-range, 1+range, num)[::-1]:

resized = cv2.resize(screen, (int(W * scale), int(H * scale)))

r = W / float(resized.shape[1])

if resized.shape[0]

break

res = cv2.matchTemplate(resized, pivot, cv2.TM_CCOEFF_NORMED)

loc = np.where(res >= res.max())

pos_h, pos_w = list(zip(*loc))[0]

if found is None or res.max() > found[-1]:

found = (pos_h, pos_w, r, res.max())

if found is None: return (0,0,0,0,0)

pos_h, pos_w, r, score = found

start_h, start_w = int(pos_h * r), int(pos_w * r)

end_h, end_w = int((pos_h + h) * r), int((pos_w + w) * r)

return [start_h, start_w, end_h, end_w, score]

• 发表于:
• 原文链接：http://kuaibao.qq.com/s/20180105A086DX00?refer=cp_1026
• 腾讯「云+社区」是腾讯内容开放平台帐号（企鹅号）传播渠道之一，根据《腾讯内容开放平台服务协议》转载发布内容。

2018-06-20

2019-03-24

2019-03-24

2019-03-24

2019-03-24

2019-03-24