opencv putText图片中写文字

图片中写入文字

#include 
#include 

int main(int argc, char *argv[])
{
    //QCoreApplication a(argc, argv);
    cv::Mat img;
    img = cv::imread("opencv.jpg");
    //std::cout <

    /////////////////图片中输入文字

    char str_lx[6];
    int num=5;
    sprintf(str_lx,"lxhello%d",num);

    cv::putText(img,str_lx,cv::Point(100,100),CV_FONT_HERSHEY_SIMPLEX,1,
                cv::Scalar(100,100));

     ///////////////////////////


    cv::imshow("core_process",img);

    cv::waitKey();
    return 0;
   // return a.exec();
}

你可能感兴趣的:(opencv)