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.
hero_detector.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录