OpenCV---在图片上添加文字

来源:互联网 发布:java swing 按键监听 编辑:程序博客网 时间:2024/05/16 12:18
/******************************************func:cvTextdesc:put text on an image@param img The image pointer which we want to put text on@param text the text pointer@param x the x coordinate@param y the y coordinate@return null******************************************/void cvText(IplImage* img, const char* text, int x, int y){CvFont font;double hscale = 2;double vscale = 2;int linewidth = 3;cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX | CV_FONT_ITALIC,hscale,vscale,0,linewidth);CvScalar textColor =cvScalar(0,255,255);CvPoint textPos =cvPoint(x, y);cvPutText(img, text, textPos, &font,textColor);}

0 0
原创粉丝点击