我想创建一个接受Drawtext函数调用并输出每个渲染字符的像素框的python函数。
例如
ffmpeg.drawtext(stream, text='C Illiterate.', fontfile=fontfile, fontcolor='white', fontsize=24, x=0, y=0, escape_text=True)
-->
C[(x,y)(x,y)], [(x,y)(x,y)], I[(x,y)(x,y)], l[(x,y)(x,y)], l[(x,y)(x,y)], i[(x,y)(x,y)], t[(x,y)(x,y)], e[(x,y)(x,y)], r[(x,y)(x,y)], a[(x,y)(x,y)], t[(x,y)(x,y)], e[(x,y)(x,y)], .[(x,y)(x,y)]
我相信函数输入是:
"max_glyph_a", "ascent", ///< max glyph ascent
"max_glyph_d", "descent", ///< min glyph descent
"max_glyph_h", ///< max glyph height
"max_glyph_w", ///< max glyph width
...
"text_h", "th", ///< height of the rendered text
"text_w", "tw", ///< width of the rendered text
"x",
"y",
...
int use_kerning; ///< font kerning is used - true/false
您能帮助我构造此功能/解密输入吗?这是用于机器视觉的应用程序。