我知道如何传递 putText 位置和字体大小:
void TextBox( cv::Mat & img, const std::string & text, const cv::Rect & bbox )
{
cv::Point position;
double size;
int face = CV_FONT_HERSHEY_PLAIN;
Trick( /*in:*/ text, bbox, face /*out:*/ position, size );
cv::putText( img, text, position, face, size, cv::Scalar( 100, 255, 100 ) );
}
Run Code Online (Sandbox Code Playgroud)
套路怎么做?我想缩放文本以适合其边界框。(字体可能是未使用的输入。)