def is_offence_shown(self, scr, threshold=0.97):
time_start = time.time()
y1 = 584
y2 = 591 + 1
x1 = 1119
x2 = 1180 + 1
offence_area = scr[y1:y2, x1:x2, :]
x, y, score = util.template_match(needle=self.offence_ff_image, haystack=offence_area)
time_req = time.time() - time_start
#print("in %.4fs" % (time_req,))
#print("is_offence_shown", x, y, score)
#misc.imshow(offence_area)
return score >= threshold
评论列表
文章目录