def draw_string(self,frame,text,x,y,fontsize=30,fontcolor=(255,255,255)):
if isinstance(frame, np.ndarray):
frame = Image.fromarray(cv2.cvtColor(frame, cv2.COLOR_BGR2RGB))
draw = ImageDraw.Draw(frame)
ttf = tempfile.gettempdir() + os.sep + 'FZZJ-ZYGDKJW.TTF'
fontStyle = ImageFont.truetype( ttf, fontsize, encoding="utf-8")
draw.text((x,y), text, fontcolor, font=fontStyle)
return cv2.cvtColor(np.asarray(frame), cv2.COLOR_RGB2BGR)