Last active
February 14, 2018 20:38
-
-
Save MareArts/dcd940d9c118eaf7dadb74f07238280b to your computer and use it in GitHub Desktop.
put text example for opencv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://study.marearts.com/2014/03/opencv-study-write-text-on-image.html | |
////////////////////////// | |
//cvPutText, IplImage case. | |
CvFont * font = new CvFont; | |
cvInitFont(font, CV_FONT_VECTOR0, 0.5f, 1.0f, 0, 1, 8); //rate of width and height is 1:2 | |
char szText[8]; | |
sprintf(szText, "TextOut"); //make string | |
cvPutText(Image, szText, CenterPoint, font, CV_RGB(255, 255, 255)); //draw text on the IplImage* (Image) | |
////////////////////////// | |
//putText, Mat case. | |
char TestStr[100]; | |
sprintf(TestStr,"total time : %lf sec", 0.001 ); | |
putText(OutImg, TestStr, Point(100,250), CV_FONT_NORMAL, 1, Scalar(255,255,255),1,1); //OutImg is Mat class; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
example is here
http://study.marearts.com/2014/03/opencv-study-write-text-on-image.html