def drawText(cimg, txt, posxy, fz):
ttFont0 = ImageFont.truetype(fontfile, fz)
im = Image.fromarray(cimg, 'RGB')
drawable = ImageDraw.Draw(im)
drawable.text ((posxy[0], posxy[1]), txt, fill=(0, 255, 0), font=ttFont0)
npimg = np.asarray(im)
return npimg
评论列表
文章目录