opencv--顯示字符

代碼:

#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>

using namespace std;
using namespace cv;

int main(int argc,char** argv)
{
    char *inputName  = argv[1];
    cout << "name = " << inputName << endl;
    Mat image = imread( inputName, 1 );
    
    CvMat _img = image;
    CvFont font;
    cvInitFont(&font,CV_FONT_VECTOR0,1,1,0,1,8);
    cvPutText(&_img,"I Love you",cvPoint(50,50),&font,CV_RGB(255,255,255));
    
    imshow( inputName, image );
    waitKey(0);
    return 0;
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章