Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write a string on IplImage

Tags:

c++

c

opencv

Is it possible to write a string on a IplImage with Opencv 2.1 in C/C++?

Thank you.

like image 582
andrea Avatar asked Feb 16 '26 06:02

andrea


1 Answers

Yes, cvPutText():

CvFont font;
double hScale=1.0;
double vScale=1.0;
int    lineWidth=1;
cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale,vScale,0,lineWidth);

cvPutText (img,"My comment",cvPoint(200,400), &font, cvScalar(255,255,0));
like image 58
karlphillip Avatar answered Feb 17 '26 18:02

karlphillip



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!