在视频中实时地显示帧率

在视频中实时地显示帧率。但是呢,想要显示什么都是可以的啦,,,

下面,我们来看一下这个函数:

void putText(Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )

参数为:

1>img – 图像矩阵

2>text – string型 文字内容

3>org – 文字坐标,以左下角为原点

4>fontFace – 字体类型  (8)

包括 FONT_HERSHEY_SIMPLEX, 

FONT_HERSHEY_PLAIN, 

FONT_HERSHEY_DUPLEX,

FONT_HERSHEY_COMPLEX,

 FONT_HERSHEY_TRIPLEX,

 FONT_HERSHEY_COMPLEX_SMALL,

FONT_HERSHEY_SCRIPT_SIMPLEX,

 FONT_HERSHEY_SCRIPT_COMPLEX

5>fontScale –字体大小

6>color – 字体颜色

7>thickness – 字体粗细

8>lineType – Line type. See the line for details.

9>bottomLeftOrigin – When true, the image data origin is at the bottom-left corner. Otherwise, it is at the top-left corner.

举例:

double rate;
char strRate[20];
sprintf(strRate, "frame rate is %.1lffps/s", rate);//.1表示小数点后仅保留一位
Scalar color = CV_RGB(0, 0, 255);
putText(frame, strRate, cvPoint(0, 20), CV_FONT_HERSHEY_DUPLEX,0.5f, color);


 

 

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值