hero_detector.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:overwatch-counter-picker 作者: cheshire137 项目源码 文件源码
def detect(self, template):
    template = cv2.cvtColor(template, cv2.COLOR_BGR2GRAY)

    if self.is_cards_screen:
      template = self.scale_template_for_cards_screen(template)

    result = cv2.matchTemplate(self.original, template, cv2.TM_CCOEFF_NORMED)
    loc = np.where(result >= self.threshold)
    points = zip(*loc[::-1])

    if len(points) > 0:
      return HeroDetector.combine_points(points)

    return None

  # Scale template down if we're on the game-over screen since the hero
  # portraits are smaller there than during the game.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号