小编ren*_*nsz的帖子

如何将文本放入 OpenCV 的边界框中?

我知道如何传递 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)

套路怎么做?我想缩放文本以适合其边界框。(字体可能是未使用的输入。)

c++ opencv

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

opencv ×1