码迷,mamicode.com
首页 > 其他好文 > 详细

PutText 在图像上显示文字

时间:2014-08-14 21:07:29      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:puttext 在图像上显示文字 opencv

核心函数:cvInitFont,cvPutText

程序:

bubuko.com,布布扣

代码:

#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <iostream>
int PutText(int argc,char** argv)
{
IplImage* src=cvLoadImage("e:\\picture\\11.jpg");
cvNamedWindow("src");
cvShowImage("src",src);
CvFont font;
cvInitFont(&font,CV_FONT_HERSHEY_COMPLEX,1.0,1.0,0,2,8);  //初始化字体
cvPutText(src,"hello",cvPoint(250,250),&font,cvScalar(0,0,255,NULL));  //显示文字
cvNamedWindow("dst");
cvShowImage("dst",src);
cvWaitKey(0);
cvDestroyWindow("src");
cvDestroyWindow("dst");
cvReleaseImage(&src);
return 0;
}


本文出自 “flyclc” 博客,请务必保留此出处http://flyclc.blog.51cto.com/1385758/1539948

PutText 在图像上显示文字,布布扣,bubuko.com

PutText 在图像上显示文字

标签:puttext 在图像上显示文字 opencv

原文地址:http://flyclc.blog.51cto.com/1385758/1539948

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!