def getTimeArea(self, img):
template_width = self.TEMPLATE_TIME.shape[1]
img_width = img.shape[1]
template = imutils.resize(self.TEMPLATE_TIME,
width=int(template_width/1280.0*img_width))
top_left, bottom_right = self.matchTemplate(img, template)
located = img[top_left[1]:bottom_right[1], top_left[0]:bottom_right[0]]
h, w = located.shape[:2]
return located[int(h*0.16):int(h*0.84), int(w*0.42):int(w*0.58)]
评论列表
文章目录