函數putText()在圖片上寫文字


 1 #include <iostream>
 2 #include <opencv2/opencv.hpp>
 3 using namespace std;
 4 using namespace cv;
 5 int main()
 6 {
 7     Mat img = imread("e.bmp");
 8     imshow("原圖", img);
 9     char tem[50];
10     sprintf(tem, "%s","Where are you?");
11     //img原圖像,tem輸出內容,Point輸出位置,0.9文字大小Scalar()顏色,1字體粗細,
12     putText(img, tem, Point(40, 250), FONT_HERSHEY_SIMPLEX, 0.9, Scalar(255, 255, 200),1,3);//在圖片上寫文字
13     namedWindow("效果圖");
14     imshow("效果圖", img);
15     waitKey();
16     return 0;
17 }

   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM