Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can refer to my following code.

string text("Any Text You Want To Put!!!");
int baseline=0;
Size text_size = getTextSize(text,FONT_HERSHEY_COMPLEX,0.75,2,&baseline);
Point text_pos(1,image.rows-text_size.height);
Rect text_rect(text_pos.x,text_pos.y-text_size.height-baseline,text_size.width,text_size.height*2);
rectangle(image,text_rect,CV_RGB(0,0,0),CV_FILLED);
putText(image, text, text_pos, FONT_HERSHEY_COMPLEX, 0.75, CV_RGB(255,255,255),2,8);