def throttle_ocr(image,coords):
img = image[coords[1]:coords[3],coords[0]:coords[2]]
# lower and upper ranges for green pixels, format BGR
lower = np.array([0,110,0])
upper = np.array([90,200,90])
res = cv2.inRange(img,lower,upper)
count = np.count_nonzero(res)
return count
评论列表
文章目录